-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Package: sveltekitIssues related to the Sentry SvelteKit SDKIssues related to the Sentry SvelteKit SDK
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? If you use the CDN bundles, please specify the exact bundle (e.g. bundle.tracing.min.js) in your SDK setup.
@sentry/sveltekit
SDK Version
7.46.0
Framework Version
1.14.0
Link to Sentry event
SDK Setup
No response
Steps to Reproduce
Instrument a Sveltekit load function in a +page.ts file with wrapLoadWithSentry, and throw a redirect.
For instance:
import { wrapLoadWithSentry } from "@sentry/sveltekit";
import { redirect } from "@sveltejs/kit";
import type { PageLoad } from "./$types";
export const load: PageLoad = wrapLoadWithSentry(async () => {
throw redirect(302, "/some/other/path");
});Expected Result
redirect errors thrown from load functions should not create a new issue in sentry, since this is just a control flow mechanism in load functions to return a redirect.
It looks like this can be ignored in the same place sentry is ignoring 4xx errors on the server side:
| if (isHttpError(objectifiedErr) && objectifiedErr.status < 500 && objectifiedErr.status >= 400) { |
And I believe there should be similar logic in the client side as well:
| const objectifiedErr = objectify(e); |
Actual Result
A new issue is created when a redirect error is thrown in a load function
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Package: sveltekitIssues related to the Sentry SvelteKit SDKIssues related to the Sentry SvelteKit SDK