This function, available in windows and workers, allows developers to report errors to the console and any global "error" event handlers, in the same way as an uncaught JavaScript exception. It is mainly useful for custom event-dispatching or callback-manipulating libraries.


This allows library developers to report exceptions in the same way the browser does, which is useful when they need more custom control over running the callback. See and for examples.


Specification link

Final published standard: Recommendation, Living Standard, Candidate Recommendation, or similar final form

Status in Chromium


Enabled by default (tracking bug)

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.


Search tags

error, exception,

Last updated on 2021-12-13