OnUnhandledRejection
Registers handlers to capture global unhandled promise rejections. (default)
This integration only works inside server environments (Node.js, Bun, Deno).
Import name: Sentry.onUnhandledRejectionIntegration
This integration is enabled by default. If you'd like to modify your default integrations, read this.
The onUnhandledRejectionIntegration
registers handlers to capture global unhandled promise rejections.
Type: boolean
If set to false, the SDK will not exit if we detect that another uncaught exception handler is registered.
Type: (firstError: Error, secondError: Error | undefined) => void
This method is called when an uncaught error would cause the process to exit. secondError
will be set if the handler was called multiple times. This can happen either because onFatalError
itself threw, or because an independent error happened somewhere else while onFatalError
was running.
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").