Error Handling

Errors Catching

Errors can be thrown by error end events or programmatically.

A thrown error MUST be caught by an error catch event, specifically using an error boundary event or an error event subprocess. Otherwise, it causes an exception.

Catching Error by Boundary Event

When an error event is caught, the activity on which the boundary event is defined is destroyed, also destroying all current executions within (concurrent activities, nested subprocesses, and so on). Process execution continues following the outgoing sequence flow of the boundary event.

error catching boundary

Event Subprocess Priority

Event subprocess has a priority over the error boundary event. So, when an error occurs, the subprocess starts, but the boundary error handler never be activated.

start error event example 2

Error Propagation

Suppose, the process has parallel paths with call activities, each of them may throw an error. Then, it’s possible to use error boundary events without outgoing flows if there is an event subprocess for handling errors:

parallel errors catch

The error, thrown inside call activity will be propagated to the top-level process and caught by event subprocess.

Matching Errors

The engine matches a thrown error and a catching event by the error code. For the rules, see Matching Errors on the Events page.

Unhandled Errors

When an error is thrown and not caught, a Flowable exception will be thrown.