sentry-react-native: Exception doesn't get sent to sentry while in dev mode?

I’m forcing my app to crash and also doing

Sentry.captureException(new Error('Oops!'), {
  logger: 'my.module'
});

but I don’t see the exception getting logged in Sentry dashboard.

I see the error and stacktrace in the raven-js module:

https://github.com/getsentry/raven-js/blob/master/src/raven.js#L1498

but when going deeper to the Objective-C native module. I see the event here:

https://github.com/getsentry/react-native-sentry/blob/master/ios/RNSentry.m#L343

But the RCTExceptionsManagerDelegate delegate never gets fired:

https://github.com/getsentry/react-native-sentry/blob/master/ios/RNSentry.m#L397-L415

On the iOS simulator, i see the react native red box error dialog.

Is it not sending to sentry because i’m in development mode?

captureMessage works perfectly.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 15 (4 by maintainers)

Most upvoted comments

@HazAT Actually throwing an exception doesn’t send any event as well for me.

I still can’t see exceptions in Sentry. I can see them If I do Sentry.captureException(throw new Error('error for sentry')). However, If there is any error thrown directly like throw new Error('error for sentry') then I can’t see it in Sentry. However, I can see exception in logs. Also, there is no luck for me to send error in production mode if app crashes. react-native: 0.44 react-native-sentry: 0.14.3

Hey, please upgrade to 0.13 this should all be resolved 😃

Yeah, don’t use captureException just call throw new Error('Oops'); instead of

Sentry.captureException(new Error('Oops!'));