An unhandled exception is an exception that propagates to the top of the call stack without any catch block, except clause, or rescue handler receiving it. What happens next depends on the runtime: a Node.js process exits, a browser tab logs to the console and abandons the current task, a request thread returns a 500.
The related case in JavaScript is an unhandled promise rejection, where a promise rejects and no .catch() or try/await is attached. These do not surface through window.onerror, so a codebase that only handles the first case misses the second.
Example
// Unhandled exception: nothing catches this
JSON.parse(responseBody);
// Unhandled promise rejection: no .catch(), no await in a try block
fetch('/api/invoices').then(r => r.json());
Neither call is in a try block, so neither error reaches your logs or your error tracker unless a top-level handler is listening for it.
What Rollbar does about unhandled exceptions
Rollbar’s browser SDK captures both cases through two configuration flags, captureUncaught and captureUnhandledRejections, so uncaught errors and rejected promises arrive as occurrences without per-call-site handling. Rollbar records each occurrence as a trace with an exception class, message, and stack trace, then groups it with the other occurrences of the same underlying condition. Rollbar assigns exceptions the level error by default and messages the level info.
Related terms
Catch uncaught errors with Rollbar.
Sources
- Rollbar Docs, Source Maps (documents
captureUncaughtandcaptureUnhandledRejectionsin_rollbarConfig): https://docs.rollbar.com/docs/source-maps - Rollbar Docs, Rollbar Terminology (occurrence types and levels): https://docs.rollbar.com/docs/rollbar-terminology