Use HTTP status code if FCM error code is unavailable

This commit is contained in:
Chris Eager authored and Chris Eager committed 2025-02-05 14:17:05 -06:00
1 parent 6545bb9edb
commit e4b0f3ced5
1 file changed
+2
@@ -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";