Conditional Error Processing
Error Handling is the process of passing an exception message issued as a result of a run-time error to take any necessary actions. This policy returns a custom error message (and the native provider's service fault content) to the application when the API Gateway or native provider returns a service fault. You can configure conditional error processing and use variables to create custom error messages.
Property | Description |
---|---|
Condition | Conditions are used to specify when the
policy has to be executed. You can add multiple conditions with logical
operators.
Available values are:
Click
Add Condition and provide the
following information and click
![]()
For details about the variables available in API Gateway, see Variables Available in API Gateway. |
Pre-Processing. Specifies how the error response is to be processed before this policy processes it. | |
Invoke webMethods Integration Server Service | Specify the webMethods IS service to
pre-process the error message.
Provide the following information
|
XSLT Transformation | Provide the XSLT file and feature you
want to use to transform the service error response.
Click Browse to select the XSLT file and upload it. Provide the following information for the XSLT feature:
You can add multiple entries for feature name and value by
clicking
Note: API Gateway supports XSLT 1.0 and XSLT 2.0.
|
Transformation Configuration. Specifies various transformations to be configured. | |
Header Transformation | Customizes the list of headers in the
error response that is sent to the client.
You can add or modify header parameters by providing the following information:
You can add multiple variables and corresponding values by
clicking
You can remove any header by typing the plain value or value with a syntax. For details about the variables available in API Gateway, see Variables Available in API Gateway. |
Status Transformation | Specifies the status transformation to be
configured for the error responses.
Provide the following information:
|
Define custom variables |
Defines a custom variable name to a complex variable expression or constant value. This can be particularly useful when you want to use this complex expression multiple times in the error payload transformation or when you want to use a short notation for a complex variable expression. Provide the following information:
For example if you provide a variable as id and the corresponding value as ${response.payload.jsonPath[$.id]}, this creates a custom variable that can be used in failure message transformation. For details about the variables available in API Gateway, see Variables Available in API Gateway. |
Failure Message. Specifies the custom failure message format that API Gateway should send to the application. | |
Failure Messages | Specifies the payload transformation to
be configured for the error responses.
|
Post-Processing. Specifies how the error response sent by the native service is to be processed before sending the same to the application. | |
Invoke webMethods Integration Server Service | Specify the webMethods IS Service for
post-processing the error message.
Provide the following information
|
XSLT Transformation | Provide the XSLT file that you want to
use to transform the service error response.
Provide the following information for the XSLT feature:
You can add multiple entries for feature names and values
by clicking
![]() Note: API Gateway supports XSLT 1.0 and XSLT 2.0.
|
Transformation Metadata. Specifies the metadata for transformation of the error responses received from the native API. For example, the namespaces configured in this section can be used when you provide the syntax for XPath ${response.payload.xpath} For example: ${response.payload.xpath[//ns:emp/ns:empName]} | |
Namespace | Specifies the namespace information to be
configured for transformation. This is applicable only for XML transformation.
Provide the following information:
|