Use HTTP status code if FCM error code is unavailable
This commit is contained in:
parent
6545bb9edb
commit
e4b0f3ced5
|
@ -104,6 +104,8 @@ public class FcmSender implements PushNotificationSender {
|
||||||
|
|
||||||
if (firebaseMessagingException.getMessagingErrorCode() != null) {
|
if (firebaseMessagingException.getMessagingErrorCode() != null) {
|
||||||
errorCode = firebaseMessagingException.getMessagingErrorCode().name();
|
errorCode = firebaseMessagingException.getMessagingErrorCode().name();
|
||||||
|
} else if (firebaseMessagingException.getHttpResponse() != null) {
|
||||||
|
errorCode = "http" + firebaseMessagingException.getHttpResponse().getStatusCode();
|
||||||
} else {
|
} else {
|
||||||
logger.warn("Received an FCM exception with no error code", firebaseMessagingException);
|
logger.warn("Received an FCM exception with no error code", firebaseMessagingException);
|
||||||
errorCode = "unknown";
|
errorCode = "unknown";
|
||||||
|
|
Loading…
Reference in New Issue