inference-playground / src /hooks.client.ts
Thomas G. Lopes
sentry sdk
7e2783c
raw
history blame
554 Bytes
import { PUBLIC_SENTRY_URL } from "$env/static/public";
import * as Sentry from "@sentry/sveltekit";
import type { HandleClientError } from "@sveltejs/kit";
Sentry.init({
dsn: PUBLIC_SENTRY_URL,
integrations: [],
});
const myErrorHandler: HandleClientError = ({ error, event }) => {
console.error("An error occurred on the client side:", error, event);
};
export const handleError = Sentry.handleErrorWithSentry(myErrorHandler);
// or alternatively, if you don't have a custom error handler:
// export const handleError = handleErrorWithSentry();