JavaScripture
Contribute via GitHub Feedback

Error : Object

An object thrown when an error occurs. There are several specific constructor functions for different types of error conditions: EvalError, RangeError, ReferenceError, SyntaxError, TypeError, URIError, NativeError.

Error(message : String) : Error
Error(message : String, options : Object) : Error

Constructors

new Error(message : String) : Error

Creates a new Error with the specified message that describes the error.

Example:

Run

Results:

 

new Error(message : String, options : Object) : Error
options : {
cause :Error
}

Creates a new Error with the specified message that describes the error and original cause of the error.

Example:

Run

Results:

 

Instance Properties

message : String

A human readable message that describes the error.

Example:

Run

Results:

 

name : String

The type of error.

Example:

Run

Results: