feat(frontend): add sentry
This commit is contained in:
parent
52606e850d
commit
1a7186061a
3 changed files with 85 additions and 3 deletions
17
frontend/src/hooks.server.ts
Normal file
17
frontend/src/hooks.server.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import { PRIVATE_SENTRY_DSN } from "$env/static/private";
|
||||
import * as Sentry from "@sentry/node";
|
||||
import type { HandleServerError } from "@sveltejs/kit";
|
||||
|
||||
Sentry.init({ dsn: PRIVATE_SENTRY_DSN });
|
||||
|
||||
export const handleError = (({ error, event }) => {
|
||||
console.log(error);
|
||||
console.log(event);
|
||||
const id = Sentry.captureException(error);
|
||||
|
||||
return {
|
||||
message: "Internal server error",
|
||||
code: 500,
|
||||
id,
|
||||
};
|
||||
}) satisfies HandleServerError;
|
Loading…
Add table
Add a link
Reference in a new issue