bugsnag-js icon indicating copy to clipboard operation
bugsnag-js copied to clipboard

onUnhandledRejection missing from React Native

Open shamilovtim opened this issue 3 years ago • 2 comments

Description

Unhandled promises are warnings. They are not crashes or exceptions. Bugsnag is treating them like "unhandled exceptions" which affects our stability score and makes it inaccurate. We care that the app is crashing, not that Promises haven't resolved successfully.

Describe the solution you'd like

To make unhandled promises be considered "handled" exceptions we require the onUnhandledRejection callback. It is not available to us neither in the JS nor on the native platforms.

Describe alternatives you've considered

The API surface on React Native is too minimal and does not provide us with many options to accomplish this a different way.

Additional context

Please consider enlarging the React Native JS API. It does not have many options like the JS API does and leaves us having to make feature requests on this repo.

shamilovtim avatar Sep 16 '22 19:09 shamilovtim

Hi @shamilovtim - we mark uncaught promise rejections as unhandled in Bugsnag because the uncaught errors could potentially mask serious errors in your application code. We expose the onUnhandledRejection callback in Node because we replace the default process.on('unhandledRejection') handler, so have to mimic the default behaviour there.

That said, I'm going to pass your feedback onto our product team to see if there's anything we can do to make these types of error identifiable via a callback 👍

luke-belton avatar Oct 04 '22 13:10 luke-belton

Hi @shamilovtim, following some internal discussion we have added an item on the roadmap to expose the event type in a callback as way for you to achieve this. At the moment we don't have an ETA for this but we will keep you updated.

johnkiely1 avatar Oct 07 '22 08:10 johnkiely1