How to set up fatal error logging with Sentry

I’ve followed the different steps in order to set up Sentry logging for my Expo app. It works as long as I use Sentry.captureException to capture the exceptions. However, I’d like to capture all fatal errors (i.e. those that are displayed in redbox in the Expo client). I especially want to be able to do this in production mode.

Does anyone know how? I’ve tried using the method outlined here using ErrorUtils, but I can’t seem to use a custom error handler.

Does anyone have any idea on how to achieve this?

Wait…I thought Sentry does this out of the box…no additional configuring needed? Any errors/exceptions (including unahndled/uncaught ones) will trigger a Sentry report.

This has been my experience at least with using Sentry.

Are you sure? Are you using it with React Native / Expo? Because you’re right when it comes to using sentry client in a web browser, because it’s been built for that. In node.js for example, you have to configure it to specifically handle uncaught exceptions.

Doesn’t work for me in Expo anyways…

I feel like I get Sentry reports for unhandled errors/exceptions, so yeah I’d say it is working for me.

Interesting… Would you mind sharing how you’ve implemented Sentry in React Native?