---
title: Creating an error handling policy in Apigee
description: 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. If the API proxy enters an error state, the normal API proxy flow can't continue to the proxy endpoint.
component: pingaccess
version: 9.0
page_id: pingaccess:agents_and_integrations:pa_creating_an_error_handling_policy_in_apigee
canonical_url: https://docs.pingidentity.com/pingaccess/9.0/agents_and_integrations/pa_creating_an_error_handling_policy_in_apigee.html
revdate: July 28, 2025
section_ids:
  about-this-task: About this task
  steps: Steps
---

# 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. If the API proxy enters an error state, the normal API proxy flow can't continue to the proxy endpoint.

## Steps

1. Add a policy with the **AssignMessage** type.

   ![A screen capture showing the Apigee policy with the AssignMessage type.](_images/alu1654900669925.png)

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

   ![A screen capture showing the default fault rule with the new policy added as a step.](_images/zbu1654901094979.png)
