diff options
| author | Fuwn <[email protected]> | 2024-07-25 03:56:52 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-07-25 03:56:52 -0700 |
| commit | 0bbebe739806e66827902fcba3d67b1795630a44 (patch) | |
| tree | 2b8676faa2112368389e25efa412da5a38542ea8 /src/trigger | |
| parent | fix(pwa): robust silent notifications (diff) | |
| download | due.moe-0bbebe739806e66827902fcba3d67b1795630a44.tar.xz due.moe-0bbebe739806e66827902fcba3d67b1795630a44.zip | |
fix(notifications): try/catch sendNotification
Diffstat (limited to 'src/trigger')
| -rw-r--r-- | src/trigger/notifications.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/trigger/notifications.ts b/src/trigger/notifications.ts index a78f1f9b..0e1e415f 100644 --- a/src/trigger/notifications.ts +++ b/src/trigger/notifications.ts @@ -31,7 +31,11 @@ export const notificationsTask = schedules.task({ ); for (const subscription of await getUserSubscriptions()) - await webpush.sendNotification(subscription['subscription'], '.'); + try { + await webpush.sendNotification(subscription['subscription'], '.'); + } catch (error) { + console.error(error); + } return {}; } |