Class actuate.xtabanalyzer.Exception
Description
A container for an XTabAnalyzer exception that supports specific exceptions. The Exception class provides an object to pass to a callback function or event handler when an exception occurs. The Exception class contains references to the exception’s origin, description, and messages.
Constructor
The Exception object is constructed when unspecified exceptions occur. The exceptions are divided into three types, which determine the contents of the Exception object. These types are:
*ERR_CLIENT: Exception type for a client-side error
*ERR_SERVER: Exception type for a server error
*ERR_USAGE: Exception type for a JSAPI usage error
Function summary
Table 8‑7 lists actuate.xtabanalyzer.Exception functions.
Table 8‑7 actuate.xtabanalyzer.Exception functions 
Function
Description
Returns details of the exception
Returns the report element for which the exception occurred, if available
Returns the error code for ERR_SERVER
Returns a short message about the error
Returns the type of error exception
Returns Boolean indicating whether exception is of certain type
getDescription
Syntax
string Exception.getDescription( )
Returns exception details as provided by the Server, Client, and User objects.
Returns
String. A detailed description of the error. Information is provided according to the type of exception generated, as shown below:
*ERR_SERVER: The SOAP string
*ERR_CLIENT: For the Firefox browser, a list comprised of fileName+number+stack
*ERR_USAGE: Any value set when the object was created
Example
This example consists of a function that registerEventHandler( ) set as a callback. The callback function takes an instance of the Exception class. Each of the functions for the Exception class can be called with the results formatted to create a message or for some other use.
function errorHandler(viewerInstance, exception){
alert(exception.getDescription( ));
}
getElement
Syntax
string Exception.getElement( )
Returns the report element for which the exception occurred, if available.
Returns
String. The report element for which the exception occurred.
Example
This example uses getElement( ):
function errorHandler(viewerInstance, exception){
alert("Error in " + exception.getElement( ));
}
getErrCode
Syntax
string Exception.getErrCode( )
Returns the error code for ERR_SERVER.
Returns
String. The error code for ERR_SERVER.
Example
This example uses getErrCode( ):
function errorHandler(viewerInstance, exception){
alert(exception.getErrCode( ));
}
getMessage
Syntax
string Exception.getMessage( )
Returns a short message about the error.
Returns
String. A short message about the exception.
Example
This example uses getMessage( ):
function errorHandler(viewerInstance, exception){
alert(exception.getMessage( ));
}
getType
Syntax
string Exception.getType( )
Returns the type of exception error.
Returns
String. The errType exception type.
Example
This example uses getType( ):
function errorHandler(viewerInstance, exception){
alert(exception.getType( ));
}
isExceptionType
Syntax
boolean Exception.isExceptionType(object exceptionType)
Checks an exception’s type for a match against a specified type.
Parameter
exceptionType
An exception type as string, or exception class. For example, "actuate.viewer.ViewerException" or actuate.viewer.ViewerException.
Returns
True if the exception is of the stated type, false otherwise.
Example
This example checks to see if the exception is a client error type:
function errorHandler(viewerInstance, exception){
if (exception.isExceptionType(ERR_CLIENT){
alert("CLIENT ERROR");
}
}