Title: SvelteKit redirects thrown in instrumented load functions should not trigger captureException · Issue #7719 · getsentry/sentry-javascript · GitHub
Open Graph Title: SvelteKit redirects thrown in instrumented load functions should not trigger captureException · Issue #7719 · getsentry/sentry-javascript
X Title: SvelteKit redirects thrown in instrumented load functions should not trigger captureException · Issue #7719 · getsentry/sentry-javascript
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/...
Open Graph 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 th...
X 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 th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/7719
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SvelteKit redirects thrown in instrumented load functions should not trigger captureException","articleBody":"### Is there an existing issue for this?\n\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [X] I have reviewed the documentation https://docs.sentry.io/\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### 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.\n\n@sentry/sveltekit\n\n### SDK Version\n\n7.46.0\n\n### Framework Version\n\n1.14.0\n\n### Link to Sentry event\n\nhttps://agent-tax.sentry.io/issues/4060190821/events/bb31c59cd19e4408b51221e4a4a1904b/?project=6229544\n\n### SDK Setup\n\n_No response_\n\n### Steps to Reproduce\n\nInstrument a Sveltekit load function in a `+page.ts` file with `wrapLoadWithSentry`, and throw a [redirect](https://kit.svelte.dev/docs/modules#sveltejs-kit-redirect).\r\n\r\nFor instance:\r\n```ts\r\nimport { wrapLoadWithSentry } from \"@sentry/sveltekit\";\r\nimport { redirect } from \"@sveltejs/kit\";\r\n\r\nimport type { PageLoad } from \"./$types\";\r\n\r\nexport const load: PageLoad = wrapLoadWithSentry(async () => {\r\n throw redirect(302, \"/some/other/path\");\r\n});\r\n```\n\n### Expected Result\n\n[`redirect` errors](https://kit.svelte.dev/docs/modules#sveltejs-kit-redirect) 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.\r\n\r\nIt looks like this can be ignored in the same place sentry is ignoring 4xx errors on the server side:\r\nhttps://github.com/getsentry/sentry-javascript/blob/776d9ce911b8f72761624abe78a5620b21981ad0/packages/sveltekit/src/server/load.ts#L22\r\n\r\n\r\nAnd I believe there should be similar logic in the client side as well:\r\nhttps://github.com/getsentry/sentry-javascript/blob/776d9ce911b8f72761624abe78a5620b21981ad0/packages/sveltekit/src/client/load.ts#L9\n\n### Actual Result\n\nA new issue is created when a redirect error is thrown in a load function","author":{"url":"https://github.com/ncvc","@type":"Person","name":"ncvc"},"datePublished":"2023-04-04T04:22:48Z","url":"https://github.com/getsentry/sentry-javascript/issues/7719"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:86706da2-ff8f-a705-b692-92fa2345070b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D398:581DC:311521:436025:6B044F86 |
| html-safe-nonce | 4046f1705e2a3c86fd529953fa1ab8eb77697c14fd34d9f0aea9b157101525a9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzk4OjU4MURDOjMxMTUyMTo0MzYwMjU6NkIwNDRGODYiLCJ2aXNpdG9yX2lkIjoiMTc3MjU2MjAwNDQ3MzgyNzIwNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5e3960009cf792ae6af119d801408e923ebfafdeaca9e131d02ee74d0a659562 |
| hovercard-subject-tag | issue:1653149119 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/7719/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8279e4ac46304105f9aa90c0764c364e5798c08b0b9475b36c5b99f9e4ed0f6d/getsentry/sentry-javascript/issues/7719 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8279e4ac46304105f9aa90c0764c364e5798c08b0b9475b36c5b99f9e4ed0f6d/getsentry/sentry-javascript/issues/7719 |
| og:image:alt | 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 th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ncvc |
| hostname | github.com |
| expected-hostname | github.com |
| None | 002aa6b95ffa730b0aec436a5c383f536ad677284e60056037fb120afe37b730 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 059f24c781e3a0d7df3f27a97da0e93fab06ae39 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width