15 lines
424 B
TypeScript
15 lines
424 B
TypeScript
import * as Sentry from '@sentry/sveltekit';
|
|
|
|
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(() => {
|
|
const errorId = Sentry.lastEventId() ?? crypto.randomUUID();
|
|
return { message: 'An unexpected error occurred', errorId };
|
|
});
|