1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-06-02 11:30:35 +02:00
This commit is contained in:
Philipp Heckel 2022-03-06 21:39:20 -05:00
parent a4fbb1b4c5
commit 3a76e4733c
3 changed files with 48 additions and 45 deletions

View file

@ -82,13 +82,21 @@ class ConnectionManager {
stateChanged(subscriptionId, state) {
if (this.stateListener) {
this.stateListener(subscriptionId, state);
try {
this.stateListener(subscriptionId, state);
} catch (e) {
console.error(`[ConnectionManager] Error updating state of ${subscriptionId} to ${state}`, e);
}
}
}
notificationReceived(subscriptionId, notification) {
if (this.notificationListener) {
this.notificationListener(subscriptionId, notification);
try {
this.notificationListener(subscriptionId, notification);
} catch (e) {
console.error(`[ConnectionManager] Error handling notification for ${subscriptionId}`, e);
}
}
}
}