Name

Do Catch — Catches exceptions as part of a try, catch, finally block

Usage

The Do Catch pattern specifies a series of steps to take when the specified exception is thrown.

The Do Catch pattern can only occur following a try pattern. It must be followed by either a processor or an endpoint.

Properties

Table 34 describes the properties you can specify using the properties editor.

Table 34. Do Catch Properties

NameDescription
DescriptionSpecifies a text description for the node. This description is included in the generated XML file, but it is informational only. It is not used by Apache Camel.
ExceptionSpecifies the list of exceptions caught. The Add button adds an entry typed in the field. The Delete button removes the selected entry from the list.
LanguageSpecifies the expression language used to process the expression.
Id

Specifies a unique identifier for the endpoint.

The tooling automatically generates an id for a node when it is created, but you can remove that id or replace it with your own. The Camel debugger requires all nodes with a breakpoint set to have a unique id.

You can use the id to refer to endpoints in your Camel XML file.

On WhenSpecifies an additional condition that should be true before the On Catch is triggered. This is used for fine grained controlling of whether thrown exception should be intercepted by this exception type or not.

Related topics

Expression and Predicates Languages
Configuring the route editor