---
title: Setting up error response handling in the target server
description: You should have an Apigee policy that handles errors returned by the target server.
component: pingauthorize
version: 10.1
page_id: pingauthorize:pingauthorize_integrations:paz_apigee_integration_error_handling
canonical_url: https://docs.pingidentity.com/pingauthorize/10.1/pingauthorize_integrations/paz_apigee_integration_error_handling.html
revdate: January 20, 2023
section_ids:
  about-this-task: About this task
  steps: Steps
---

# 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

1. Go to API Proxies → httpbin\_bad\_response → Develop and create a new ReturnGenericError policy of type AssignMessage. Configure the policy as desired.

   ![Screen capture of the ReturnGenericError policy creation within Apigee](_images/rzw1673906971414.png)

2. 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. |

   ![Screen capture of adding the ReturnGenericError policy as a step within the DefaultFaultRule for the API proxy in Apigee](_images/zys1673907502466.png)
