The AJAX Errors are caught within the State Machine Diagram. The <<UIStates>> are wrapped by a surrounding Composite State which will catch all exceptions and errors which might occur and then delegate these via <<UIErrorTransitions>> to the error handling <<UIStates>>.
Figure: Error Handling State Machine Diagram
The definition of which type of AJAX error, a fault or a connection error, should be caught, depends on how the <<UIErrorTransitions>> are specified. Any fault or error happening within the <<UIStates>> and are held by the Composite State will be caught.
AJAX Fault Handling
Due to almost all E2E UI requests going to an E2E xUML service, the service exceptions need to be caught and delegated to the user interface. The exception signal/event holds more information on the error that occurred and all this information can be displayed to the user.
Figure: Example of generating an error in a example service
As seen in the above figure, a service handling an AJAX request, sends an <<Exception>> . This exception will be caught by the E2E UI and can be e.g. display that error to a user as below figure shows.
Figure: AJAX Error Dialog
Figure: <<UIErrorTransition>> for AJAX Fault
The <<UIErrorTransition>> further defines which type of error should be caught by defining the ajaxFaultCode as well as the ajaxFaultType. In case of the above figure all exceptions are caught by using the *** in both cases. This allows having different user interfaces for different types of errors.
Figure: Configuration to Catch AJAX Faults
|code||An error code, defined and set in the service where the <<Exeption>> signal is sent.|
|type||The type of error, defined and set in the service where the <<Exeption>> signal is sent.|
|description||A description of the error, defined and set in the service where the <<Exeption>> signal is sent.|
|category||The category of the error e.g. User or System|
AJAX Connection Error Handling
Connection errors occur when a request to a service times out or is not possible at all due to the service is e.g. not running. The error which is caught returns back the URL it tried to connect to. The implementation within the model follows the same principle as with AJAX faults. The error is caught by the Composite State and is redirected to the <<UIErrorTransition>> which handles the connection error. The difference is in the settings of the transition.
Figure: Configuration to Catch AJAX Connection Faults
Figure: <<UIErrorTransition>> for AJAX Connection Fault