Worker: error event
Note: This feature is available in Web Workers, except for Service Workers.
The error
event of the Worker
interface fires when an error occurs in the worker.
Syntax
Use the event name in methods like addEventListener()
, or set an event handler property.
js
addEventListener("error", (event) => {});
onerror = (event) => {};
Event type
A generic Event
.
Example
Specifications
Specification |
---|
HTML Standard # handler-abstractworker-onerror |
Browser compatibility
BCD tables only load in the browser