Creating an error handling policy in Apigee
About this task
When the target server returns an error, having an Apigee policy to handle that error prevents the API proxy from going into an error state in the target endpoint response and preventing the normal API proxy flow from continuing to the proxy endpoint.
Steps
-
Add a policy with the AssignMessage type.
-
Edit the target endpoint and add the new policy as a step in the default fault rule.
For example:
<DefaultFaultRule name="fault-rule"> <Step> <Name>ReturnGenericError</Name> </Step> </DefaultFaultRule>