Defines a generic Error type. When the target platform is JS, Error extends the native js.lib.Error type.

Static methods

staticfromDynamic(err:Dynamic, ?pos:PosInfos):Error

It creates an instance of Error from any value.

If err is already an instance of Error, it is returned and nothing is created.

Constructor

new(message:String, ?stack:Array<StackItem>, ?pos:PosInfos)

The Error constructor only requires a string message. stack and pos are automatically populated, but can be provided if preferred.

Variables

read onlymessage:String

The text message associated with the error.

read onlypos:PosInfos

The location in code where the error has been instantiated.

read onlystackItems:Array<StackItem>

The collected error stack.

Methods