Overview
globalErrorIntegration listens for the window's error and unhandledrejection events and reports each one through captureException(). It's the only integration enabled by default — every uncaught exception and every rejected promise nobody awaited ends up on the Issues page without any extra code.
A rejection whose reason isn't an Error (e.g. Promise.reject('nope')) is wrapped in one, so it still gets a name, message and stack.
Usage
Nothing to do — it's registered by init() automatically. To turn it off:
ts
import { disable } from '@buglapse/browser'
disable('global-error')To replace it with your own implementation, pass an integration named 'global-error' in init({ integrations }) — see Create integration.
Errors thrown inside setTimeout, requestAnimationFrame or event listener callbacks are also caught here, but browsers strip them down to Script error. when the script comes from another origin without CORS, and such an error is skipped — there's nothing to report. BrowserApiErrorsIntegration keeps the original error at the source; with it enabled, this integration reports that original instead.