Sentry - captureMessage or captureException - manually send information

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 Additional Configuration | Sentry Documentation) 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

Yes, you can do this:

import Sentry from "sentry-expo";

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

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 });


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