Class xbException — Provide an wrapper for Javascript Exceptions
extends Class xbObject
class xbException : xbObject { // constructor xbException(String errorMessage, String errorFile, String errorFunction, Object nativeException = null); // properties String errorMessage; String errorFile; String errorFunction; String nativeMessage Variant nativeException }
// throw a 'pure' xbException throw( new xbException('message', 'file', 'function')); // throw a 'wrapper' xbException var error; try { // some code } catch(error) { throw( new xbException('message', 'file', 'function', error)); }
xbException is meant as a portable Exception/Error class. IE's and Mozilla's implementations of Error Exceptions, etc differ in terms of properties making it difficult to handle exceptions. xbException is meant to be constructed either as a standalone 'pure' exception or as an exception wrapper for the native exceptions thrown by the browser.
readonly String - a description of the error.
readonly String - name of file where the error occurred.
readonly String - name of function where the error occurred.
readonly String - error message constructed from the native exception's properties.
readonly Object - reference to the native exception if any.
Constructs an instance of the xbException class.
If nativeException is already a xbException, i.e nativeException.isa == 'xbException' then the new xbException is a clone of nativeException ignoring the errorMessage, errorFile, errorFunction parameters. This allows a 'wrapper' xbException to be thrown and then propagated up through a chain of xbException's all the while keeping the original error information.
If nativeException is not already a xbException, the xbException is constructed from the input parameters.
Returns. nothing
Exceptions
None