---
title: On Exception
description: Learn about On Exception
documentId: ipaas-legacy-on-exception
locale: en-US
---

The **On Exception** tool is a *step* that executes alternative routes when there are errors that do not return a *status code*. 
This way, the execution of the integration flow is not interrupted.

Below, learn how to add it to the canvas and configure its form.

## Add On Exception to the canvas

<Steps>
<Step>
Click the ![tool icon with plus sign](https://creative-ball-51b3fc85c0.media.strapiapp.com/general_Tools_Icon_43cb976f10.png) icon in the left editing menu.
</Step>
<Step>
Select **On Exception** to add it to the canvas.
You can use the search bar ![](https://creative-ball-51b3fc85c0.media.strapiapp.com/search_steps_icon_245a7221ea.png) to find it.

<Callout type="note" title="NOTE">
You can add **On Exception** more than once.
In this case, each time the tool is added, a number is appended to the name (On Exception 1, On Exception 2, On Exception 3).
</Callout>
</Step>
<Step>
Connect **On Exception** to the output connection of a *step* and add subsequent *steps* to create an exception flow.
</Step>
</Steps>

The connection between **On Exception** and the *step* immediately before it will have a dotted line to differentiate the exception flow from the main flow. 
When you hover over this *step*, a *tooltip* will appear indicating that it is an exception flow (*Exception flow*).

---
**General connection rules for On Exception**

* **On Exception** indicates the beginning of the exception flow and must connect to the output connection of a [*connector*](/docs/integrations/ipaas-legacy-connectors).

* **On Exception** can have more than one input connection. 
This means that different *connectors* can execute the same exception flow. 

* **On Exception** can have only one output connection.

* The [*Rest API Connector*](/docs/integrations/ipaas-legacy-connectors-rest-api) can be connected to only one **On Exception**.

* It is mandatory to connect the exception flow to the **End** *step* of the main flow.

* If you delete the connection line between **On Exception** and another *step*, you will see the alert icon on **On Exception**.
---

### Exception flow inside **For Each**

You can create an exception flow with **On Exception** inside **For Each**. 

In this case, the following rules apply: 

| For Each | Rest API | On Exception |
|---|---|---|
| "Ignore Errors" enabled → | "Ignore Errors" disabled → | will be executed and proceed to the next iteration |
| "Ignore Errors" disabled → | "Ignore Errors" disabled → | will be executed and NOT proceed to the next iteration |
| "Ignore Errors" enabled → | "Ignore Errors" enabled → | will NOT be executed and will NOT proceed to the next iteration |

## Configure the form

<Steps>
<Step>
Select **On Exception** on the canvas.
</Step>
<Step>
Click the edit icon ![pencil icon](https://creative-ball-51b3fc85c0.media.strapiapp.com/edit_icon_34464736ca.png).
</Step>
<Step>
Fill in the following fields:
* **Name**: enter a unique name for the *step*. 
By default, you will see "On Exception". 
Alphanumeric field with a limit of 20 characters. 
Special characters and whitespace are not allowed.
* **Exception**: select the exceptions for executing the alternative route.
To delete any exception, you must select them one by one. 

<Callout type="note" title="NOTE">
To delete all selected exceptions, click the **X** to the right of the selected exceptions.
</Callout>

**List of exceptions:**
- **Network Errors** - Connection Timeout
- **Network Errors** - Socket Error
- **DNS Resolution Error** - Host Not Found
- **SSL/TLS Errors** - SSL Handshake Failure
- **Timeout Errors** - Read/ Write Timeout
- **General Exception**

* **Retry interval (ms)**: add the time interval between retries, in milliseconds. 
The default interval is 5000ms and the maximum interval is 30000ms.

* **Retry Quantity**: add the number of retries. 
The default quantity is 2 retries and the maximum quantity is 5 retries.

---
By clicking the **Properties** icon ![list icon](https://creative-ball-51b3fc85c0.media.strapiapp.com/properties_icon_2c777edb35.png) on the right, you can:

1. Select previously registered variables. 
2. Select input or output *payloads* from previous *steps*.
3. Create expressions using the Expression Builder.

<Callout type="note" title="NOTE">
Read more about [**Properties and Expression Builder**](/docs/integrations/ipaas-legacy-expression-builder).
</Callout>
---
</Step>
<Step>
When you finish configuring the form, click **CONFIRM**.
</Step>
</Steps>

![](https://creative-ball-51b3fc85c0.media.strapiapp.com/on_exception_552c7823d1.png)

To copy the **On Exception** *step* and its settings, click the tool icon on the canvas and click the ![copy icon](https://creative-ball-51b3fc85c0.media.strapiapp.com/copy_icon_813a455d76.png) button on the right.

To delete **On Exception** from the canvas, select it and click the ![trash icon](https://creative-ball-51b3fc85c0.media.strapiapp.com/remove_Icon_486c52eeeb.png) button.
