From d509965a3d8881f02da4d06ab193fb75f8181f21 Mon Sep 17 00:00:00 2001 From: dangered wolf Date: Fri, 10 Nov 2023 04:52:36 -0500 Subject: [PATCH] Don't let onError fail if no sentry --- src/worker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/worker.ts b/src/worker.ts index ba6eb8c..1523dba 100644 --- a/src/worker.ts +++ b/src/worker.ts @@ -67,7 +67,7 @@ app.use('*', async (c, next) => { }); app.onError((err, c) => { - c.get('sentry').captureException(err); + c.get('sentry')?.captureException?.(err); console.error(err.stack); c.status(200); c.header('cache-control', noCache);