Setting up error response handling in the target server
About this task
You should have an Apigee policy that handles errors returned by the target server.
If you don’t configure error handling using a policy, the API proxy goes into an error state in the <TargetEndpoint> response, and the normal API proxy flow won’t continue to the <ProxyEndpoint>.
Steps
-
Go to API Proxies → httpbin_bad_response → Develop and create a new ReturnGenericError policy of type AssignMessage. Configure the policy as desired.
-
Select the PreFlow option in the Target Endpoints for your API proxy. Add the error policy you just created as a
<Step>in the<DefaultFaultRule>.There are multiple methods for adding the error handling policy.