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

Constructor

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

The Error constructor only requires a steing message. stack and pos are automatically populate but can be provided if preferred.

Variables

read onlypos:PosInfos

The location in code where the error has been instantiated.

read onlystackItems:Array<StackItem>

The collected error stack.

Methods

getPosition ():String

stackToString ():String

toString ():String

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.