Skip to content

Commit

Permalink
Use HTTP status code if FCM error code is unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
eager-signal committed Feb 5, 2025
1 parent 6545bb9 commit e4b0f3c
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ public CompletableFuture<SendPushNotificationResult> sendNotification(PushNotifi

if (firebaseMessagingException.getMessagingErrorCode() != null) {
errorCode = firebaseMessagingException.getMessagingErrorCode().name();
} else if (firebaseMessagingException.getHttpResponse() != null) {
errorCode = "http" + firebaseMessagingException.getHttpResponse().getStatusCode();
} else {
logger.warn("Received an FCM exception with no error code", firebaseMessagingException);
errorCode = "unknown";
Expand Down

0 comments on commit e4b0f3c

Please sign in to comment.