Skip to content

Commit

Permalink
Change the warning levels.
Browse files Browse the repository at this point in the history
  • Loading branch information
prasanthu committed Oct 23, 2019
1 parent 8f72520 commit 53ceeb4
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,15 @@ class FirebaseAppNotifier: AppNotifier {
override fun onFailure(t: Throwable) {
if (t is FirebaseMessagingException) {
val errorCode = t.errorCode
logger.warn("Notification for $customerId with appId: ${token.applicationID} " +
"failed with errorCode: $errorCode")
if (listOfFailureCodes.contains(errorCode)) {
logger.warn("Removing failed token for $customerId with appId: ${token.applicationID} " +
// Known failure, we should remove this token from our list
logger.info("Removing failed token (errorCode: $errorCode) for $customerId with appId: ${token.applicationID} " +
"token: $token.token")
store.removeNotificationToken(customerId, token.applicationID)
} else {
// Other failures we should look into.
logger.warn("Notification for $customerId with appId: ${token.applicationID} " +
"failed with errorCode: $errorCode")
}
} else {
logger.warn("Notification for $customerId with appId: ${token.applicationID} " +
Expand Down

0 comments on commit 53ceeb4

Please sign in to comment.