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

# Record Error • Rust AI Agent SDK

> record_error: Record a failed call.

# record\_error

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**ApiStats**](../classes/ApiStats) class in the [**telemetry**](../modules/telemetry) module.

Record a failed call.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def record_error(&mut self, duration: Duration, status_code: Option<u16>) -> ()
```

## Parameters

<ParamField query="duration" type="Duration" required={true}>
  No description available.
</ParamField>

<ParamField query="status_code" type="Option<u16>" required={true}>
  No description available.
</ParamField>

### Returns

<ResponseField name="Returns" type="()">
  The result of the operation.
</ResponseField>

***

## 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>
