Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native - Sentry.captureException not working

I'm trying to use Sentry.captureException in my React Native app, but it's not working properly. I'm receiving the eventId, but there is no issues on Sentry website.

Here is the code:

const eventId = Sentry.captureException(new Error("Testing"));
console.log(eventId); /// ccfa8f3799524c8ea9e138fb792******

PS. Native errors are working fine, if I try throw('Testing') it works.

PS. Android only, iOS is working fine

  • RN: 0.63.3
  • @sentry/react-native: 2.0.0
like image 816
Gurzoni Avatar asked Aug 30 '26 08:08

Gurzoni


1 Answers

You can use it like this:

Sentry.captureEvent({
    event_id: <error_id>,
    message: <message>,
    extra: <data_in_json>,
});
like image 69
Anurag Chutani Avatar answered Sep 01 '26 16:09

Anurag Chutani