Uncaught errors are not captured on React Native
See original GitHub issueWhen using Raven in ReactNative, any error that is thrown outside of a try-catch
block is not captured. It looks like there was an attempt to capture by calling ErrorUtils.setGlobalHandler
. Unfortunately, in production the errors are never captured because the app crashes before the request is complete.
One option is to skip the defaultHandler
, which is what causes the app to crash. However, the best behaviour is application-specific.
Perhaps the best solution is to avoid attempting calling ErrorUtils.setGlobalHandler
at all in the React Native plugin, and instead to provide documentation for users to do it themselves?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to handle errors globally in react native? - Stack Overflow
react -native-exception-handler is a react native module that lets you register a global error handler that captures fatal/non-fatal uncaught ...
Read more >Handling Errors in React Native: A Complete Guide
react -native-exception-handler is a react native module that lets you register a global error handler that captures fatal/non-fatal uncaught ...
Read more >React Native Error Handling Best Practices - Rollbar
React Native has its own mechanism to handle uncaught exceptions. This allows you to track the error, display a message to the user, ......
Read more >Error Boundaries - React
As of React 16, errors that were not caught by any error boundary will result in unmounting of the whole React component tree....
Read more >react-native-exception-handler - npm
A react native module that lets you to register a global error handler that can capture fatal/non fatal uncaught exceptions.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey, Check out our official client for react-native -> https://github.com/getsentry/react-native-sentry Closing this here since it’s obsolete. If you’re still having troubles, please create an issue there. Thanks
Thanks. I still have some troubles with CodePush and Sentry. Can you help me? I reached you on Twitter 😃 Thanks!