diff --git a/apps/frontend/web/worker.ts b/apps/frontend/web/worker.ts index d4acb37f..dc141c7d 100644 --- a/apps/frontend/web/worker.ts +++ b/apps/frontend/web/worker.ts @@ -18,4 +18,14 @@ const app = new Hono(); app.use('*', staticAssets(), remix({ build: build as any })); +app.onError((err, c) => { + if (err.message) { + console.log(...err.message.trim().split('\n')); + } + if (err.stack) { + console.log(...err.stack.trim().split('\n')); + } + return c.json({ status: 500, messsage: err?.message ?? 'Internal Error' }, 500); +}); + export default app;