From c69bd30aaa03e5602b5eb5e7f26107ae604a643a Mon Sep 17 00:00:00 2001 From: Lucas Berger Date: Tue, 9 Jun 2026 22:20:43 -0400 Subject: [PATCH] fix(05-review): WR-03 log error.message not raw error in push route catch blocks --- apps/api/src/routes/push.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/api/src/routes/push.ts b/apps/api/src/routes/push.ts index b453dd2..6c3bed8 100644 --- a/apps/api/src/routes/push.ts +++ b/apps/api/src/routes/push.ts @@ -114,7 +114,10 @@ pushRouter.post('/subscription', zValidator('json', subscribeSchema), async (c) return c.json({ ok: true }, 201) } catch (err) { - console.error('[push/POST /subscription] DB operation failed:', err) + console.error( + '[push/POST /subscription] DB operation failed:', + err instanceof Error ? err.message : String(err), + ) return c.json({ error: 'Service unavailable' }, 503) } }) @@ -133,7 +136,10 @@ pushRouter.delete('/subscription', async (c) => { await db.delete(pushSubscriptions).where(eq(pushSubscriptions.userId, userId)) return c.json({ ok: true }) } catch (err) { - console.error('[push/DELETE /subscription] DB operation failed:', err) + console.error( + '[push/DELETE /subscription] DB operation failed:', + err instanceof Error ? err.message : String(err), + ) return c.json({ error: 'Service unavailable' }, 503) } })