-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ErrorBoundary errors are being incorrectly marked as unhandled since 5.9.2 #10985
Comments
Hi @julianD77, @Lms24 could you share more details about the reasons for this change? |
@julianD77 You can overwrite the default values in beforeSend: (event: Sentry.Event, hint) => {
if (event.exception?.values?.[1]?.type?.startsWith('React ErrorBoundary')) {
event.exception?.values?.forEach(value => {
if (value.mechanism) {
value.mechanism.handled = true;
} else {
value.mechanism = {
type: 'generic',
handled: true,
};
}
});
}
return event;
}, |
So the initial reasoning for setting More details: #6073 (comment) However, as you correctly pointed out, we can actually determine this in the error boundary case by checking if a |
Since this is completely implemented in JS I'm moving this issue to the JS repository. |
I opened #10989 with the fix. Appreciate reviews! |
#10989) Previously, we made a change to always mark such errors as unhandled (#8914). However, as pointed out and discussed in #10985, this isn't always the best default value. I propose we set handled/unhandled depending on the presence of the `fallback` component. If users specify a fallback, I think it's safe to mark the error handled, given that users show something else instead of the errored component.
#10989) Previously, we made a change to always mark such errors as unhandled (#8914). However, as pointed out and discussed in #10985, this isn't always the best default value. I propose we set handled/unhandled depending on the presence of the `fallback` component. If users specify a fallback, I think it's safe to mark the error handled, given that users show something else instead of the errored component.
I backported this fix to v7 and it will be released with 7.108.0 soon. cc @krystofwoldrich |
Fixed released with https://github.com/getsentry/sentry-javascript/releases/tag/7.107.0 |
OS:
Platform:
SDK:
@sentry/react-native
(>= 1.0.0)react-native-sentry
(<= 0.43.2)SDK version: 5.15.2
react-native
version: 0.72.9react
version: 18.2.0Are you using Expo?
Are you using sentry.io or on-premise?
If you are using sentry.io, please post a link to your issue so we can take a look:
Issue where the error is classified as unhandled
https://mixcloud.sentry.io/discover/ios:45b823357fd441a6bb2ccc68581d293e
Issue (in older release) where the same error is classified as handled
https://mixcloud.sentry.io/discover/ios:18fd9d35a97c4f49a920b4d1ca465d25
Configuration:
I have the following issue:
Some 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 anErrorBoundary
and does not result in a hard crash when the error occurs. The fallback component we provide to the error boundary is triggered.Potentially relevant is the fact that in older releases of our App where we were using
react-native
0.66.5,react
17.0.2 andsentry/react-native
version 4.15.0 the very same errors were thrown from the same code are reported ashandled: true
by Sentry.Steps to reproduce:
ErrorBoundary
, such as :ExampleComponent
Surrounding
ErrorBoundary
Actual result:
Expected result:
ErrorBoundary
Is the fact that in the Sentry issue UX (and the JSON for error) the
metadata.type
isReact ErrorBoundary Error
in the newer release where the error is classified as unhandled, andError
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.Here 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.
Can anyone think of any reason why the same error scenarios are now being classified as Unhandled by Sentry?
The text was updated successfully, but these errors were encountered: