vexi.js.Exception - Exception Object

The Exception constructor takes two optional arguments, the first argument sets the Exception message and the second sets the Exception type.

var exn = new vexi.js.Exception("arbitray message", "arbitrary type");

Alternatively you can simply throw a String — i.e. throw "message" — but this approach will interrupt your application if the thrown Exception is not caught by a catch clause higher up in the call stack.

Properties

Property Type Description

backtrace

Array

Returns the backtrace as an Array of Strings. One array for each line in the backtrace.

cause

Exception

Property used for exception chaining. If the reason to throw the exception is not being able to recover when handling another exception then this can be set so that complete information about the error can be communicated up out of the call stack.

message

String

The message describing the reason the exception was thrown

type

String

The type of the exception

 


Copyright © 2011 The Vexi Project (vexi.sourceforge.net)