-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
- Review the documentation: https://docs.sentry.io/
- Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- Use the latest release: https://github.com/getsentry/sentry-javascript/releases
- Provide a link to the affected event from your Sentry account
Package + Version
@sentry/[email protected]
Description
Errors thrown in global event processors are picked up by the Sentry lib, initiating another error capture which in turn calls the same global event processor that will throw an error once more. This repeats for an unknown number of times (until the stack overflows perhaps?). The issue is that there's no trace of the original error, nor any subsequent errors thrown by the faulty global event processor. Sentry is obviously unable to send the error upstream, but nothing is logged either.
Discovering that a faulty global event processor was preventing any of our errors from being reported took some time, so it would be great if the SDK could detect and log these errors automatically. Until then I recommend wrapping the processing code in a try/catch block and manually log errors:
Sentry.addGlobalEventProcessor(event => {
try {
event.missingProperty.assignment = true
} catch (err) {
console.error('sentry global event processor threw error', err)
}
return event
})