ErrorEvent: ErrorEvent() constructor
Note: This feature is available in Web Workers.
The ErrorEvent() constructor creates a new ErrorEvent object.
Syntax
js
new ErrorEvent(type)
new ErrorEvent(type, options)
Parameters
type-
A string with the name of the event. It is case-sensitive.
optionsOptional-
An object that, in addition of the properties defined in
Event(), can have the following properties:messageOptional-
A string containing a human-readable error message describing the problem.
filenameOptional-
A string containing the name of the script file in which the error occurred.
linenoOptional-
An integer containing the line number of the script file on which the error occurred.
colnoOptional-
An integer containing the column number of the script file on which the error occurred.
errorOptional-
A JavaScript value, such as an
ErrororDOMException, representing the error associated with this event.
Return value
A new ErrorEvent object.
Specifications
| Specification |
|---|
| HTML> # errorevent> |