From dff81f7bfb6b6e0fb50039f62b8a1c6ec3d25c7a Mon Sep 17 00:00:00 2001 From: Marcel Date: Sun, 17 May 2026 09:41:58 +0200 Subject: [PATCH] feat(observability): add handleError callback to hooks.client.ts returning errorId Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/hooks.client.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/hooks.client.ts b/frontend/src/hooks.client.ts index 91ed4b10..c837a49f 100644 --- a/frontend/src/hooks.client.ts +++ b/frontend/src/hooks.client.ts @@ -4,7 +4,11 @@ Sentry.init({ dsn: import.meta.env.VITE_SENTRY_DSN, environment: import.meta.env.MODE, tracesSampleRate: 1.0, + sendDefaultPii: false, enabled: !!import.meta.env.VITE_SENTRY_DSN }); -export const handleError = Sentry.handleErrorWithSentry(); +export const handleError = Sentry.handleErrorWithSentry(() => { + const errorId = Sentry.lastEventId() ?? crypto.randomUUID(); + return { message: 'An unexpected error occurred', errorId }; +});