Error Handling

Building a solution where one expects everything to behave correctly is only part of the story. A solution should accommodate error conditions as well.

When an error is caught, the XMLElement at tw.system.error contains some data.

Within a service, we can define an Error End Event. When this is reached, the service comes to an end and an error condition is raised.

The name or identity of the error condition is supplied in the Implementation tab in the "Error Code" field.

In a BPD where a call might be made to such a service, an Error Intermediate Event can be attached to handle such an error:

A handler can be added to catch a particular named error or a handler can be added to catch all errors. If we can't remember the names of all the errors, we can be provided with a list of possible errors from the selection entry on the far right.

An additional way to handle errors in our environment is to provide an "Event Subprocess". This is a sub-process which will be invoked when an error condition (general or specific) is detected.

See also:

Error Handling in JavaScript

Code within services that is written in JavaScript can include the try/catch mechanism to surround code that may fail. For example:

 // Some code here
 log.error("Caught an exception: " + myException.message);
No Comments
Back to top