aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-09-06 19:00:45 -0700
committerAnton Tananaev <anton@traccar.org>2022-09-06 19:00:45 -0700
commit3ae99730940f0f108a0c655f0cb52c109ca57885 (patch)
treebe5a12dddec929144067501558decb1861dfb898 /src/main/java/org/traccar
parentfa78acf7876851e6e15e116ebe25f2f65a28fea0 (diff)
downloadtrackermap-server-3ae99730940f0f108a0c655f0cb52c109ca57885.tar.gz
trackermap-server-3ae99730940f0f108a0c655f0cb52c109ca57885.tar.bz2
trackermap-server-3ae99730940f0f108a0c655f0cb52c109ca57885.zip
Handle Firebase error responses
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/notificators/NotificatorFirebase.java7
1 files changed, 6 insertions, 1 deletions
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);
}