Class actuate.viewer.ViewerException
Description
A container for an exception. ViewerException provides an object to pass to a handler when the user-defined ON_EXCEPTION event occurs. It contains a reference to the element that generated the exception.
Constructor
The ViewerException object is constructed when an ON_EXCEPTION event occurs. 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 44‑56 lists actuate.viewer.ViewerException functions.
Table 44‑56 actuate.viewer.ViewerException functions
Function
Description
Returns the element for which the exception occurred
Returns the exception message
getElement
Syntax
object ViewerException.getElement( )
Returns an instance of the element that caused the exception, if applicable. The instance can be an object of one of following types:
*actuate.report.Chart
*actuate.report.DataItem
*actuate.report.Label
*actuate.report.Table
*actuate.report.TextItem
To determine the object type, use the Object.getType( ) function. The type strings for the above objects are "Chart", "Data", "Label", "Table", or "Text", respectively.
Returns
Object. An instance of the element that generated the exception.
Example
This example displays the type of element that generated the exception in an alert box:
alert("Exception in " + vException.getElement.getType( ));
getErrorMessage
Syntax
string ViewerException.getErrorMessage( )
Returns the error message for the exception.
Returns
String. A server error message.
Example
This example displays the server error code in an alert box:
alert("Server error message: " + vException.getErrorMessage( ));