From 3ae99730940f0f108a0c655f0cb52c109ca57885 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 6 Sep 2022 19:00:45 -0700 Subject: Handle Firebase error responses --- src/main/java/org/traccar/notificators/NotificatorFirebase.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/org/traccar/notificators/NotificatorFirebase.java b/src/main/java/org/traccar/notificators/NotificatorFirebase.java index 6510963c7..3723a4226 100644 --- a/src/main/java/org/traccar/notificators/NotificatorFirebase.java +++ b/src/main/java/org/traccar/notificators/NotificatorFirebase.java @@ -84,7 +84,12 @@ public class NotificatorFirebase implements Notificator { .build(); try { - FirebaseMessaging.getInstance().sendMulticast(message); + var result = FirebaseMessaging.getInstance().sendMulticast(message); + for (var response : result.getResponses()) { + if (!response.isSuccessful()) { + throw new MessageException(response.getException()); + } + } } catch (FirebaseMessagingException e) { throw new MessageException(e); } -- cgit v1.2.3