Use the TryCatch node to provide a special handler for exception processing.
This topic contains the following sections:
Initially, the input message is routed on the Try terminal, which you must connect to the remaining non-error processing nodes of the message flow. If a downstream node (which can be a Throw node) throws an exception, the TryCatch node catches it and routes the original message to its Catch terminal. Connect the Catch terminal to further nodes to provide error processing for the message after an exception. If the Catch terminal is connected, the message is propagated to it. If the Catch terminal is not connected, the message is discarded.
The TryCatch node is contained in the Construction drawer of the palette, and is represented in the workbench by the following icon:
Use the Throw and TryCatch nodes when you use the Compute node to calculate a total. You can create a message that is sent to your system administrator when the total that is calculated exceeds the maximum value for the Total field.
When you have put an instance of the TryCatch node into a message flow, you can configure it; see Configuring a message flow node. The properties of the node are displayed in the Properties view.
Optional: On the Description tab, enter a short description, a long description, or both. You can also rename the node on this tab.
The TryCatch node has no configurable properties that affect its operation. You determine how it operates by connecting the output terminals to subsequent nodes in your message flow.
When an exception is thrown in the message flow, either by the explicit use of the Throw node or the ESQL THROW statement, or by the broker raising an implicit exception when it detects an error that the message flow is not programmed to handle, control returns to the TryCatch node.
The message is propagated through the Catch terminal and the error handling that you have designed is executed. The message that is propagated through this terminal has the content that it had at the point at which the exception was thrown, including the full description of the exception in the ExceptionList.
The TryCatch node terminals are described in the following table.
Terminal | Description |
---|---|
In | The input terminal that accepts a message for processing by the node. |
Catch | The output terminal to which the message is propagated if an exception is thrown downstream and caught by this node. |
Try | The output terminal to which the message is propagated if it is not caught. |
The following table describes the node properties. The column headed M indicates whether the property is mandatory (marked with an asterisk if you must enter a value when no default is defined); the column headed C indicates whether the property is configurable (you can change the value when you add the message flow to the bar file to deploy it).
The TryCatch node Description properties are described in the following table.
Property | M | C | Default | Description |
---|---|---|---|---|
Node name | No | No | The node type | The name of the node. |
Short Description | No | No | A brief description of the node. | |
Long Description | No | No | Text that describes the purpose of the node in the message flow. |