feat(observability): add handleError callback to hooks.server.ts returning errorId
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@ 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
|
||||
});
|
||||
|
||||
@@ -122,4 +123,7 @@ export const handleFetch: HandleFetch = async ({ event, request, fetch }) => {
|
||||
|
||||
export const handle = sequence(userGroup, handleAuth, handleLocaleDetection, handleParaglide);
|
||||
|
||||
export const handleError = Sentry.handleErrorWithSentry();
|
||||
export const handleError = Sentry.handleErrorWithSentry(() => {
|
||||
const errorId = Sentry.lastEventId() ?? crypto.randomUUID();
|
||||
return { message: 'An unexpected error occurred', errorId };
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user