> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# On Error • Rust AI Agent SDK

> OnError: Error handling behavior

# OnError

> Defined in the [**task**](../modules/task) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

Error handling behavior

## Fields

| Name       | Type      | Description            |
| ---------- | --------- | ---------------------- |
| `Stop`     | `variant` | -                      |
| `workflow` | `variant` | -                      |
| `on`       | `variant` | -                      |
| `error`    | `variant` | -                      |
| `default`  | `variant` | Stop workflow on error |
| `Stop`     | `variant` | Stop workflow on error |
| `Continue` | `variant` | -                      |
| `to`       | `variant` | -                      |
| `next`     | `variant` | -                      |
| `task`     | `variant` | -                      |
| `Continue` | `variant` | Continue to next task  |
| `Retry`    | `variant` | -                      |
| `the`      | `variant` | -                      |
| `task`     | `variant` | -                      |
| `Retry`    | `variant` | Retry the task         |

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/task/mod.rs">
  `praisonai/src/task/mod.rs` at line 0
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Error Handling" icon="triangle-exclamation" href="/docs/rust/error-handling" />

  <Card title="Rust Retry" icon="rotate-right" href="/docs/rust/retry" />

  <Card title="Rust Failover" icon="shield" href="/docs/rust/failover" />
</CardGroup>
