OverviewSingleDeprecated

jsx3.lang

class Exception

Object
->jsx3.lang.Object
  ->jsx3.lang.Exception

Direct Known Subclasses:

jsx3.lang.IllegalArgumentException, jsx3.lang.NativeError

class Exception
extends jsx3.lang.Object
The base GI exception class.

Throwing an Exception

// throwing a simple exception:
throw new jsx3.Exception("an error occurred");

// throwing a nested exception:
try {
  ...
} catch (e) {
  throw new jsx3.Exception("an error occurred while ...", 
      jsx3.NativeError.wrap(e));
}

Catching an Exception

// catching an exception and logging it
try {
  ...
} catch (e) {
  jsx3.util.Logger.GLOBAL.error("an error occurred while ...", 
      jsx3.NativeError.wrap(e));
}

Since:

3.1

Constructor Summary
void
init(strMessage : String, objCause : jsx3.lang.Exception)
The instance initializer.
Method Summary
jsx3.lang.Exception
Returns the cause of this exception, if one was specified in the constructor.
String
Returns the description of this exception, as specified when the constructor was called.
Array<Function>
Returns the complete call stack from when this exception was instantiated as an array of functions.
String
Returns a string representation of the call stack for when this exception was instantiated.
String
Returns a string representation of this exception.
Methods Inherited From jsx3.lang.Object
clone, equals, eval, getClass, getInstanceOf, getInstanceOfClass, getInstanceOfPackage, instanceOf, isInstanceOf, isSubclassOf, jsxmix, jsxsuper, jsxsupermix, setInstanceOf
Constructor Detail

init

void init(strMessage : String, objCause : jsx3.lang.Exception)
The instance initializer. A subclass of this class should always chain its init() method.

Parameters:

strMessagethe description of the exception.
objCausean optional argument. A caught exception that caused this exception to be raised.
Method Detail

getCause

jsx3.lang.Exception getCause()
Returns the cause of this exception, if one was specified in the constructor.

Returns:

 

getMessage

String getMessage()
Returns the description of this exception, as specified when the constructor was called.

Returns:

 

getStack

Array<Function> getStack()
Returns the complete call stack from when this exception was instantiated as an array of functions.

Returns:

 

printStackTrace

String printStackTrace()
Returns a string representation of the call stack for when this exception was instantiated. This stack trace is delimited by new line characters (\n) but is not terminated with one.

Returns:

 

toString

String toString()
Returns a string representation of this exception.

Returns:

 

Overrides:

toString in jsx3.lang.Object