View source

class thx.Error

Available on all platforms

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

Class Fields

static function fromDynamic(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.

Instance Fields

Toggle inherited fields

var message(default,null):String

Available on cpp, cs, java, neko, php, python, swf

The text message associated with the error.

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

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

var pos(default,null):PosInfos

The location in code where the error has been instantiated.

var stackItems(default,null):Array<StackItem>

The collected error stack.

function toString():String