-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/sveltekit
SDK Version
"@sentry/sveltekit": "^8.30.0"
Framework Version
"@sveltejs/kit": "^2.5.26",
Link to Sentry event
No response
Reproduction Example/SDK Setup
This setup:
import { sequence } from "@sveltejs/kit/hooks";
import { sentryHandle } from "@sentry/sveltekit";
import type { HandleServerError } from "@sveltejs/kit";
import * as Sentry from "@sentry/sveltekit";
Sentry.init({
dsn: "dsn",
tracesSampleRate: 1.0,
beforeSend(event, hint) {
console.warn(`π‘Why is Sentry's beforeSend hook is running π‘`);
return null;
},
});
// If you have custom handlers, make sure to place them after `sentryHandle()` in the `sequence` function.
export const handle = sequence(sentryHandle());
const myErrorHandler: HandleServerError = ({}) => {
console.log('Lets ignore error - i.e. we are NOT reporting');
return;
};
export const handleError = Sentry.handleErrorWithSentry(myErrorHandler);
ALWAYS report, i.e. the beforeSend always run.
Steps to Reproduce
- Clone repo here
- Start dev server with
npm run dev
- Make an error appear:
curl http://localhost:5173 test-route -X POST
Sentyr.bug.in.sveltekit.mp4
Expected Result
beforeSend should not fire, because we don't report the error in myErrorHandler
.
Actual Result
beforeSend does actually fire!
oxymc
Metadata
Metadata
Assignees
Labels
Projects
Status
Waiting for: Product Owner