sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

Add `onunhandledrejection` error machanism type to rejected promises

Open romtsn opened this issue 1 year ago • 1 comments

Description

Currently we override whatever mechanism comes from the JS sdk, see here: https://github.com/getsentry/sentry-react-native/blob/c2a4e9b9386a596d6e84a9d857c77418388c0e5f/src/js/integrations/reactnativeerrorhandlers.ts#L146-L160

Perhaps we should preserve the original mechanism type at least, because it might be useful when filtering issues in issue stream/discover. One such case was reported with regards to onunhandledrejection type for unhandled promise rejections.

romtsn avatar Sep 16 '24 15:09 romtsn

We create a new event in the global error handler and we set the error mechanism, there is no previous value.

onunhandledrejection is handled at: https://github.com/getsentry/sentry-react-native/blob/933804ec2ad2153b9bd42d91bff2bb69d7f2a672/packages/core/src/js/integrations/reactnativeerrorhandlers.ts#L81-L85

And I agree we should add the correct mechanism to it.

krystofwoldrich avatar Sep 30 '24 12:09 krystofwoldrich

Done in https://github.com/getsentry/sentry-react-native/pull/4457

krystofwoldrich avatar Jan 24 '25 12:01 krystofwoldrich