feat(frontend): add sentry

This commit is contained in:
Sam 2023-03-14 22:56:47 +01:00
parent 52606e850d
commit 1a7186061a
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
3 changed files with 85 additions and 3 deletions

View 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;