cancel
Showing results for 
Search instead for 
Did you mean: 

Handling Exception in APIM

maiconsbr
Explorer
1,116

Hello,

Is it possible to handle the exception received from Gateway in API Management?

I need to add a policy in order to customize the response content before send it back to client, but it is not working properly.

Condition: error.state equals "TARGET_RESP_FLOW"

Policy added to outgoing response of Target Endpoint but it not being called.

From debug:

Current Step: Error

Properties:
error:Received non success response code
type:ErrorPoint
state:TARGET_RESP_FLOW
error.class:com.apigee.errors.http.server.BadGateway

Thanks in advance,

Maicon.

Accepted Solutions (1)

Accepted Solutions (1)

divyamary
Advisor
Advisor

Hi ,

By default the policies that are defined in the response stream are ignored in case of error from the target endpoint. To override this behavior you can set the success.codes property in the target endpoint properties to 2xx,3xx,4xx,5xx (refer screenshot)

Thanks and Best Regards,

Divya

Answers (0)