mirror of
https://github.com/LukeHagar/website.git
synced 2025-12-10 04:22:18 +00:00
fix: dont send errors in dev mode
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
import { SENTRY_DSN } from "$lib/constants";
|
import { dev } from '$app/environment';
|
||||||
import { handleErrorWithSentry, replayIntegration } from "@sentry/sveltekit";
|
import { SENTRY_DSN } from '$lib/constants';
|
||||||
|
import { handleErrorWithSentry, replayIntegration } from '@sentry/sveltekit';
|
||||||
import * as Sentry from '@sentry/sveltekit';
|
import * as Sentry from '@sentry/sveltekit';
|
||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
|
enabled: !dev,
|
||||||
dsn: SENTRY_DSN,
|
dsn: SENTRY_DSN,
|
||||||
tracesSampleRate: 1.0,
|
tracesSampleRate: 1.0,
|
||||||
|
|
||||||
@@ -15,7 +17,7 @@ Sentry.init({
|
|||||||
replaysOnErrorSampleRate: 1.0,
|
replaysOnErrorSampleRate: 1.0,
|
||||||
|
|
||||||
// If you don't want to use Session Replay, just remove the line below:
|
// If you don't want to use Session Replay, just remove the line below:
|
||||||
integrations: [replayIntegration()],
|
integrations: [replayIntegration()]
|
||||||
});
|
});
|
||||||
|
|
||||||
// If you have a custom error handler, pass it to `handleErrorWithSentry`
|
// If you have a custom error handler, pass it to `handleErrorWithSentry`
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ import type { Handle } from '@sveltejs/kit';
|
|||||||
import redirects from './redirects.json';
|
import redirects from './redirects.json';
|
||||||
import { sequence } from '@sveltejs/kit/hooks';
|
import { sequence } from '@sveltejs/kit/hooks';
|
||||||
import { BANNER_KEY, SENTRY_DSN } from '$lib/constants';
|
import { BANNER_KEY, SENTRY_DSN } from '$lib/constants';
|
||||||
|
import { dev } from '$app/environment';
|
||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
|
enabled: !dev,
|
||||||
dsn: SENTRY_DSN,
|
dsn: SENTRY_DSN,
|
||||||
tracesSampleRate: 1
|
tracesSampleRate: 1
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user