Title: SvelteKit 4XX errors thrown in load functions should not trigger captureException · Issue #10568 · getsentry/sentry-javascript · GitHub
Open Graph Title: SvelteKit 4XX errors thrown in load functions should not trigger captureException · Issue #10568 · getsentry/sentry-javascript
X Title: SvelteKit 4XX errors thrown in load functions should not trigger captureException · Issue #10568 · 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/10568
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SvelteKit 4XX errors thrown in 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?\n\n@sentry/sveltekit\n\n### SDK Version\n\n7.100.1\n\n### Framework Version\n\nSvelteKit 2.5.0\n\n### Link to Sentry event\n\nhttps://agent-tax.sentry.io/issues/4905544148/?notification_uuid=3d8bb633-3ad0-4712-ae79-3a44fe73b25c&project=4504771498868736\n\n### SDK Setup\n\n```typescript\r\nSentry.init({\r\n dsn: \"\u003cdsn>\",\r\n integrations: [\r\n browserTracingIntegration(),\r\n captureConsoleIntegration({\r\n levels: [\"warn\", \"error\", \"assert\"],\r\n }),\r\n ],\r\n release,\r\n environment: \"\u003cenvironment>\",\r\n // Set tracesSampleRate to 1.0 to capture 100%\r\n // of transactions for performance monitoring.\r\n // We recommend adjusting this value in production\r\n tracesSampleRate: 1.0,\r\n attachStacktrace: true,\r\n ignoreErrors: [\r\n ...\r\n ],\r\n });\r\n```\n\n### Steps to Reproduce\n\nUsing Sveltekit, throw a 4XX error in the load function for a page, and then navigate to that page via client-side navigation.\r\n\r\nIn my specific case, I can repro by logging in to my site and opening another tab (both tabs are now logged in). I logout on one of the tabs and then navigate to another page on the other tab. That page's load function hits an API that returns a 403, which is then thrown as a sveltekit [`error(403)`](https://kit.svelte.dev/docs/modules#sveltejs-kit-error). The page is rendered using `+error.svelte`, but sentry captures the exception.\r\n\r\nOn the server side [sentry ignores 4XX errors](https://github.com/getsentry/sentry-javascript/blob/ca6010bbd65f65b287802e611f702d000e5f4f56/packages/sveltekit/src/server/load.ts#L27), but on the client side [it doesn't](https://github.com/getsentry/sentry-javascript/blob/ca6010bbd65f65b287802e611f702d000e5f4f56/packages/sveltekit/src/client/load.ts#L17C7-L17C17). I think sentry should ignore 4XX errors on the client side as well, unless I'm missing some reason that these should not be ignored on the client side.\n\n### Expected Result\n\n4XX errors are ignored by sentry on the client and server side\n\n### Actual Result\n\n4XX errors are ignored by sentry on the server side, but not on the client side.","author":{"url":"https://github.com/ncvc","@type":"Person","name":"ncvc"},"datePublished":"2024-02-08T06:16:12Z","url":"https://github.com/getsentry/sentry-javascript/issues/10568"}
| 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:22d85542-6d33-70bd-0cf5-e95403cacc65 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A010:373A8C:300EBF5:3EBDB12:6B0425E7 |
| html-safe-nonce | fc1deb07b075c7367ae818ad66e66cc3cda01cd2aaef40bcf45d449cbadfc1e9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDEwOjM3M0E4QzozMDBFQkY1OjNFQkRCMTI6NkIwNDI1RTciLCJ2aXNpdG9yX2lkIjoiMjM3NTI3NDQxMjkzNDE3ODI3OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e64bc34d4b195e0a0ea769e380504f020e83c966e1c1268cbf05b9bc936c2a4f |
| hovercard-subject-tag | issue:2124434145 |
| 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/10568/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2bd5dd4f743aa1e3bbb4be808ce06d503fc18e173f6b4c438d0840be11168b1e/getsentry/sentry-javascript/issues/10568 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2bd5dd4f743aa1e3bbb4be808ce06d503fc18e173f6b4c438d0840be11168b1e/getsentry/sentry-javascript/issues/10568 |
| 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 | f8d9f404447ab5df341c8a92cf5fc927730ad1321e64ac57656444d2438097f1 |
| 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 | f7edccce04851591ee529948701779ce6819bc53 |
| 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