2023-03-14 22:56:47 +01:00
|
|
|
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);
|
2023-04-17 23:10:59 +02:00
|
|
|
// const id = Sentry.captureException(error);
|
2023-03-14 22:56:47 +01:00
|
|
|
|
|
|
|
return {
|
|
|
|
message: "Internal server error",
|
|
|
|
code: 500,
|
2023-04-17 23:10:59 +02:00
|
|
|
//id,
|
2023-03-14 22:56:47 +01:00
|
|
|
};
|
|
|
|
}) satisfies HandleServerError;
|