Handling errors in the assembly
Use the catch section of the assembly to describe the handling of errors thrown during the assembly execution.
About this task
- This task relates to configuring an OpenAPI 3.0 API definition. For details on how to configure an OpenAPI 2.0 API definition, see Editing an OpenAPI 2.0 API definition.
- OpenAPI 3.0 APIs are supported only with the DataPower® API Gateway, not with the DataPower Gateway (v5 compatible).
- For details of current OpenAPI 3.0 support limitations, see OpenAPI 3.0 support in IBM® API Connect.
You can complete this task either by using the API Designer UI application, or by using the browser-based API Manager UI.
The catch section of the assembly is used to implement an assembly in the instance that an error
is thrown during the assembly execution. For example, the assembly could contain a
throw
element, the API caller could fail to authenticate, or a policy could fail to
execute correctly. Each error can be handled with a different catch and each catch can handle
multiple status errors.
Procedure
To create a catch and include elements in it, complete the following steps:
What to do next
If you added a catch for ConnectionError,
SOAPError, or OperationError, you must add the same
error to the Stop on error setting for the Invoke
policy in
your assembly. Otherwise, if the error occurs during the execution of the Invoke
policy, it is not caught, the policy execution is allowed to complete, and the assembly flow
continues. For details on configuring an Invoke
policy, see Invoke.
For details of all the errors that can be returned by the assembly and are available to the catch function, see Error cases supported by assembly catches.