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
Go to ReturnGenericError policy
of type AssignMessage. Configure the policy as
and create a new
Select the PreFlow option in the Target
Endpoints for your API proxy. Add the error policy you just
created as a
There are multiple methods for adding the error handling policy.