addErrorHandler()

Adds an error handler to the framework.

Syntax

JavaScriptâ„¢ Method

addErrorHandler(eventListener);

where:

Argument Description
eventListener The name of a JavaScript function.

Usage

Error handlers are invoked when the framework receives a communication or Simple Object Access Protocol (SOAP) error response from the server. The error handler is a JavaScript function of the form:

boolean errorHandler( SoapResponse response )
where SoapResponse has the following method and attributes:
  • boolean SoapResponse.hasFault();
  • String SoapResponse.faultReason;
  • String SoapResponse.faultCode;
  • String SoapResponse.faultSubcode;

The error handler should return true if it has handled the error and should stop any further processing of the error. If the error handler returns false, the error is sent to any remaining error handlers in the list. In any case, after an error, the framework returns without updating Blox UI contents or busy states.