FaultHandling
Use the FaultHandling policy to modify the code or message returned by the server
in case of an error.
Example
In this example, the status code and message are replaced by the specified status code and message.
<faultHandling
xmlns="http://www.infor.com/ion/api"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
name="faultHandling-example" displayName="faultHandling-example" enabled="true" version="1.0">
<rules>
<rule>
<statusCode>500</statusCode>
<set>
<statusCode>502</statusCode>
<message>Please contact the system administrator.</message>
<set>
</rule>
</rules>
</faultHandling>
Configuration
Element name | Default | Presence | Type | Multiplicity |
---|---|---|---|---|
rules | n/a | Required | n/a | 1 |
rules.rule | n/a | Required | n/a | 1..* |
rules.rule.statusCode |
n/a | Required | string | 1 |
rules.rule.set | n/a | Optional | n/a | 0..1 |
rules.rule.set.StatusCode | n/a | Optional | string | 0..1 |
rules.rule.set.message | n/a | Optional | string | 0..1 |
<faultHandling> attributes
<faultHandling name="faultHandling-example" displayName="faultHandling-example" enabled="true" version="1.0">
Field name | Description | Default | Presence |
---|---|---|---|
name | Name of this policy instance. | N/A | Required |
displayName | Optional | ||
enabled | Indicates if a policy is enforced or not. If set to false, a policy is turned off, and not enforced. | true | Optional |
version | policy version | N/A | Required |
<rules> element
List of rules to be enforced by this policy.
<rules.rule> element
Rule to be enforced by this policy.
<rules.rule.statusCode> element
Http code that in the response that would trigger the execution of this rule.
<rules.rule.set> element
Elements in the response that are set if this rule is executed.
<rules.rule.set.statusCode> element
Http code to set if the enclosing rule is executed.
<rules.rule.set.message> element
Message to return if the enclosing rule is executed.