Microgateway 10.5 | webMethods Microgateway Help | Policies | Error Handling | Conditional Error Processing
 
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 native provider returns a service fault. You can configure conditional error processing and use variables to create custom error messages.
The table lists the properties that are supported for this policy in Microgateway:
Parameter
Description
Error conditions. Specifies the error conditions and how these error conditions should be processed.
Status Code Error Criteria
Specify the error status code.
Provide a value for the Code.
Header Error Criteria
Provide the details of the custom HTTP header(s) included in the client requests.
Provide the following information:
*Header Name. Specifies the name of the HTTP header.
*Header Value. Specifies the value of the HTTP header.
Payload Criteria
Provide the details of the payload criteria in the API request.
You can have the following information in the payload identifier section:
*Expression type. Specifies the type of expression, which is used for identification. You can select one the following expression type:
*XPath. Provide the following information:
*Payload Expression. Specifies the payload expression that the specified XPath expression type in the request or the response has to be converted to. For example: /name/id.
The response maybe a native service error or Microgateway generated error.
*Namespace Prefix. The namespace prefix of the payload expression to be validated.
*Namespace URI. The namespace URI of the payload expression to be validated.
Note:
You can include multiple namespace prefix and URI.
*JSONPath. Provide the Payload Expression that specifies the payload expression that the specified JSONPath expression type in the request or the response has to be converted to. For example: $.name.id.
The response maybe a native service error or Microgateway generated error.
*Text. Provide the Payload Expression that specifies the payload expression that the specified Text expression type in the request or response has to be converted to. For example: any valid regular expression.
The response maybe a native service error or Microgateway generated error.
You can add multiple payload identifiers as required.
Note:
Only one payload identifier of each type is allowed. For example, you can add a maximum of three payload identifiers, each being of a different type.
Value: Specifies a value that has to match with the value contained in the error Response.
Custom Error Variables. Specifies the error variables to be used in the custom error message.
Payload Type
Specify the payload type.
Available values are:
*Request. Specifies the request payload type.
*Response. Specifies the response payload type.
Name
Provide a name for the payload type.
Payload Identifier
Provide the details of the payload criteria in the API request.
Provide the following information in the Payload identifier section:
*Expression type. Specifies the type of expression contained in the payload request.
*Payload Expression. Specifies the payload expression that the specified expression type in the request has to be converted to.
*Namespace Prefix. The namespace prefix of the payload expression to be validated.
*Namespace URI. The namespace URI of the payload expression to be validated.
Note:
You can add multiple namespace prefix and URI.
You can add multiple payload identifiers as required.
Failure Message. Specifies the custom failure message format that Microgateway should send to the application. Specify whether the message should be in the text, json, or xml format.
Send Native Provider Fault Message
Enable this parameter so that Microgateway sends the native REST failure message to the application.
When you disable this parameter, the failure message is ignored when a fault is returned by the native API provider.