Use HTTP status code if FCM error code is unavailable

This commit is contained in:
Chris Eager 2025-02-05 13:48:07 -06:00 committed by Chris Eager
parent 6545bb9edb
commit e4b0f3ced5
1 changed files with 2 additions and 0 deletions

View File

@ -104,6 +104,8 @@ public class FcmSender implements PushNotificationSender {
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";