Title: ErrorBoundary errors are being incorrectly marked as unhandled since 5.9.2 · Issue #10985 · getsentry/sentry-javascript · GitHub
Open Graph Title: ErrorBoundary errors are being incorrectly marked as unhandled since 5.9.2 · Issue #10985 · getsentry/sentry-javascript
X Title: ErrorBoundary errors are being incorrectly marked as unhandled since 5.9.2 · Issue #10985 · getsentry/sentry-javascript
Description: OS: Windows MacOS Linux Platform: iOS Android SDK: @sentry/react-native (>= 1.0.0) react-native-sentry (<= 0.43.2) SDK version: 5.15.2 react-native version: 0.72.9 react version: 18.2.0 Are you using Expo? Yes No Are you using sentry.io ...
Open Graph Description: OS: Windows MacOS Linux Platform: iOS Android SDK: @sentry/react-native (>= 1.0.0) react-native-sentry (<= 0.43.2) SDK version: 5.15.2 react-native version: 0.72.9 react version: 18.2.0 Are you usi...
X Description: OS: Windows MacOS Linux Platform: iOS Android SDK: @sentry/react-native (>= 1.0.0) react-native-sentry (<= 0.43.2) SDK version: 5.15.2 react-native version: 0.72.9 react version: 18.2.0 Are y...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/10985
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ErrorBoundary errors are being incorrectly marked as unhandled since 5.9.2","articleBody":"**OS:**\r\n- [x] Windows\r\n- [x] MacOS\r\n- [x] Linux\r\n\r\n**Platform:**\r\n- [ ] iOS\r\n- [x] Android\r\n\r\n**SDK:**\r\n- [x] `@sentry/react-native` (>= 1.0.0)\r\n- [ ] `react-native-sentry` (\u003c= 0.43.2)\r\n\r\n**SDK version:** 5.15.2\r\n\r\n**`react-native` version:** 0.72.9\r\n**`react` version:** 18.2.0\r\n\r\n**Are you using Expo?**\r\n- [ ] Yes\r\n- [x] No\r\n\r\n**Are you using sentry.io or on-premise?**\r\n- [x] sentry.io (SaaS)\r\n- [ ] on-premise\r\n\r\n**If you are using sentry.io, please post a link to your issue so we can take a look:**\r\n\r\nIssue where the error is classified as unhandled\r\nhttps://mixcloud.sentry.io/discover/ios:45b823357fd441a6bb2ccc68581d293e\r\n\r\nIssue (in older release) where the same error is classified as handled\r\nhttps://mixcloud.sentry.io/discover/ios:18fd9d35a97c4f49a920b4d1ca465d25\r\n\r\n**Configuration:**\r\n\r\n```\r\nSentry.init({\r\n dsn: env.SENTRY,\r\n ignoreErrors: IGNORE_ERRORS,\r\n environment: IS_DEVELOPMENT_BUILD ? 'development' : 'production',\r\n debug: IS_DEVELOPMENT_BUILD,\r\n release: sentryRelease,\r\n dist: getBuildNumber()\r\n});\r\n```\r\n\r\n---\r\n**I have the following issue:**\r\n\r\nSome Javascript errors that are being thrown explicitly by our Application code are being reported as Unhandled i.e. `handled: false` in Sentry - yet the code that throws the error is surrounded by an `ErrorBoundary` and does not result in a hard crash when the error occurs. The fallback component we provide to the error boundary is triggered. \r\n\r\nPotentially relevant is the fact that in older releases of our App where we were using `react-native` 0.66.5, `react` 17.0.2 and `sentry/react-native` version 4.15.0 the very same errors were thrown from the same code are reported as `handled: true` by Sentry.\r\n\r\n**Steps to reproduce:**\r\n- Trigger code that throws an error but is contained within an `ErrorBoundary`, such as :\r\n\r\n`ExampleComponent`\r\n\r\n```\r\n ...\r\n if (!cloudcast) {\r\n throw new Error(`No cloudcast found for id ${cloudcastId}`);\r\n }\r\n ...\r\n```\r\n\r\nSurrounding `ErrorBoundary`\r\n\r\n```\r\n \u003cErrorBoundary\r\n fallback={fallback}\r\n onBack={onBack}\r\n onRetry={onRetry}\r\n >\r\n \u003cOfflineBoundary fallback={fallback}>\r\n \u003cReact.Suspense fallback={fallback}>\r\n \u003cExampleComponent>\r\n \u003c/React.Suspense>\r\n \u003c/OfflineBoundary>\r\n \u003c/ErrorBoundary>\r\n```\r\n\r\n**Actual result:**\r\n\r\n- The fallback component renders but the error is reported to Sentry and classified as unhandled\r\n\r\n**Expected result:**\r\n\r\n- The fallback component renders and the error is reported to Sentry and classified as handled, since it has been caught by an `ErrorBoundary`\r\n\r\nIs the fact that in the Sentry issue UX (and the JSON for error) the `metadata.type` is `React ErrorBoundary Error` in the newer release where the error is classified as unhandled, and `Error` in the older release where the error is correctly classified as handled? As mentioned the relevant application code has not changed - but the underlying RN dependencies have.\r\n\r\nHere is a screenshot showing the same error across the two different releases, the left-hand side is our newer release using RN0.72.9 where the error is classified as unhandled. The right-hand side is the older release where the error is classified as handled.\r\n\r\n\r\n\r\n\r\nCan anyone think of any reason why the same error scenarios are now being classified as Unhandled by Sentry? \r\n\r\n\r\n","author":{"url":"https://github.com/julianD77","@type":"Person","name":"julianD77"},"datePublished":"2024-02-27T20:35:03Z","url":"https://github.com/getsentry/sentry-javascript/issues/10985"}
| 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:24aec0eb-cf03-b670-0d19-a821b5a33388 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9EBE:43FF1:985BDA:C095E2:6B0362F4 |
| html-safe-nonce | d5cc2c3b3a99582d57686ac48418fbed6740992493a581fe58034fc1d8e9e586 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RUJFOjQzRkYxOjk4NUJEQTpDMDk1RTI6NkIwMzYyRjQiLCJ2aXNpdG9yX2lkIjoiODY0NTUwMTg2NzA1ODc1MDE5NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ba4f419a7cbca2063972b9c65d9a4c68db11d7f8c95d108d6c075fd57e9c6f44 |
| hovercard-subject-tag | issue:2175996226 |
| 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/10985/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3741101634d50dffa11ddcd06b4d0051b1c769111c205e95c6775aefbb085c00/getsentry/sentry-javascript/issues/10985 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3741101634d50dffa11ddcd06b4d0051b1c769111c205e95c6775aefbb085c00/getsentry/sentry-javascript/issues/10985 |
| og:image:alt | OS: Windows MacOS Linux Platform: iOS Android SDK: @sentry/react-native (>= 1.0.0) react-native-sentry (<= 0.43.2) SDK version: 5.15.2 react-native version: 0.72.9 react version: 18.2.0 Are you usi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | julianD77 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| 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