Sentry - captureMessage or captureException - manually send information


#1

Is it possible to send information to Sentry, outside of a crash? I’ve found cases where crash report isn’t providing sufficient information but there are places in the code where I could send data up to Sentry to get better insight on the cause. I’ve attempted to use Sentry.captureMessage and Sentry.captureException (as mentioned here https://docs.sentry.io/clients/react-native/config/) but neither seems to work. I wasn’t sure if it was related to Expo (rather than standard react-native) or what.

Just curious if anyone knows if this (sending information to Sentry outside of an actual crash) is possible (or not).

Thank you


#2

Yes, you can do this:

import Sentry from "sentry-expo";

Sentry.captureException(new Error("My error"));

#3

Thanks for the reply.

For anyone else looking (I was having difficulty finding this on the Sentry site), you can pass up extra information by calling:

Sentry.captureException(new Error("My error"), { extra: obj });


closed #4

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.