BIRT Data Analyzer API classes : Class actuate.xtabanalyzer.Exception

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:

n  
n  
n  

Function summary

Table 5-7 lists actuate.xtabanalyzer.Exception functions.

Returns the report element for which the exception occurred, if available.

actuate.xtabanalyzer.Exception.getDescription

Syntax

string Exception.getDescription( )

Returns exception details as provided 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:

n  
n  
n  

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( ));
}

actuate.xtabanalyzer.Exception.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( ));
}

actuate.xtabanalyzer.Exception.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( ));
}

actuate.xtabanalyzer.Exception.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( ));
}

actuate.xtabanalyzer.Exception.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( ));
}

actuate.xtabanalyzer.Exception.isExceptionType

Syntax

boolean Exception.isExceptionType(object exceptionType)

Checks an exception’s type for a match against a specified type.

Parameters

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");
  }
}

(c) Copyright Actuate Corporation 2011