Syvizo

Generate Fault



When to use

Use this policy when you want to generate error based on a condition



Details

API Flow Manager provides the capability to implement custom exception handling using the Generate Fault policy. This policy allows you to generate a customized fault response when a specific error condition is encountered.

By utilizing the Generate Fault policy, you can define a fault response that is returned to the client application when the specified error condition occurs. The fault response can include HTTP headers, query parameters, and a message payload, providing more meaningful information to both app developers and end users compared to generic error messages or standard HTTP response codes.

When the Generate Fault policy is executed, the response is sent back in the response and no other policies in the flow are executed.

Using the Generate Fault policy, you can create customized fault responses, improving the error handling experience for client applications and enhancing the overall developer experience.



Configuration

The configuration fields for the policy are:

[* Indicates a mandatory field]

Name *: Display name of the policy

Description: Description of policy

Enabled: Flag to indicate if the policy is enabled. If this field is not checked, the policy will be ignored at runtime and any fields from its output will contain a default initial value



Input fields

statusCode: The XML string which should be converted to json

message: Error message to be sent in response

payload: Request or response payload or any custom created payload

headers: Headers that you want to send in response



Output fields

None