you're passing a string to Sentry.captureException
, not an actual Error
object:
useEffect(() => {
if (error) {
Sentry.captureException(new Error('TEST: ' + error));
}
}, [error]);
Above code ensures that Sentry captures a real exception object.