# Action Error Output

Route Flux action errors to another channel for handling or notification.

When an action returns an error, you can send the error details to another channel. This allows you to run error-handling actions or consolidate results from multiple actions.

> [!WARNING]
>
> If you do not configure error output for an action, processing from that action stops when an error occurs.

## Configure Error Output

1. Open the **Studio** tab of the Flux App in Soracom Flux Studio.

   For more details, see [Open a Flux App](https://docs.soracom.io/en/services/flux/management#open-a-flux-app).

2. Open the action for which you want to configure error output.

3. **Error Output**: Enable **Republish the action error to another channel**.

4. Specify the destination channel:

   - **Create a new channel**: Enter a name in **Channel Name**.

   - **Select an existing channel**: Choose the channel from the dropdown list.

   ![Error Output settings for an action](https://docs.soracom.io/_astro/action-error-output.v_IJ8zDF_ZoOLSA.webp)

5. Click **Update**.

   An error output channel is added to the action.

## Advanced Settings

Under **Error Output > Advanced settings**, you can transform the data before sending it to another channel. For details on behavior shared with action output settings, see [Advanced Action Output Settings](https://docs.soracom.io/en/services/flux/advanced-action-output).

Enable **Transform data** and configure the following fields:

| Field | Description |
| - | - |
| **Content-Type** | Specify the Content-Type of the data to be sent to another channel. |
| **Content** | Configure the transformation content. The transformed result is treated as the error output. Use `${payload.xxx}` to reference the input to the action. Use `${error.xxx}` to reference the error details. |

Example: Send both the action input (`${payload}`) and the error details (`${error}`) together.

```json
{
  "payload": "${payload}",
  "error": "${error}"
}
```

> [!WARNING]
>
> In error output, `${result}` is `null`.

> [!WARNING]
>
> You can extract or compute intermediate data during the Flux App execution. For details on supported expressions, see [Use Expressions in Actions](https://docs.soracom.io/en/services/flux/action-expressions).
