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

# Errors

> Every exception the SDK raises, what raises it, and what to catch.

```python theme={null}
from zeroruntime.teleops import NotAligned, RoomError
```

`NotAligned` and `RoomError` are on the package root. The rest live in the module
that raises them.

## What is raised

| Exception | Import from | Raised when |
| - | - | - |
| `NotAligned` | `zeroruntime.teleops` | the two arms are too far apart to arm safely, or `arm_when_aligned()` ran out of time |
| `RoomError` | `zeroruntime.teleops` | room creation failed, no token, or a room id that is not real |
| `RecordingError` | `zeroruntime.teleops.recordings` | the API refused a cloud-recording request |
| `SchemaMismatch` | `zeroruntime.teleops.protocol` | a frame did not decode as this protocol, or a group was missing or the wrong size |
| `CalibrationError` | `zeroruntime.teleops.adapters.so101_calibration` | no calibration file, corrupt JSON, or an empty calibration |
| `ValueError` | | no token passed and `ZERORUNTIME_AUTH_TOKEN` unset |
| `TypeError` | | `on_starvation=TORQUE_OFF` without overriding `torque_enable()`. Raised at construction |
| `RuntimeError` | | `tick()` called before `start()` |

## What to catch

The subclassing decides this.

| Exception | Subclasses |
| - | - |
| `NotAligned` | `RuntimeError` |
| `RoomError` | `RuntimeError` |
| `RecordingError` | `RoomError` |
| `SchemaMismatch` | `ValueError` |
| `CalibrationError` | `ValueError` |

`RecordingError` subclasses `RoomError`, so one `except RoomError` around
session setup catches every API failure, cloud recording included.

```python theme={null}
from zeroruntime.teleops import RoomError

try:
    follower.start()
except RoomError as e:
    print("could not set up the session:", e)
```

## Arming

`NotAligned` is the one you will catch most, since it is raised on purpose
whenever arming would make the follower travel to meet a leader that is
somewhere else.

```python theme={null}
from zeroruntime.teleops import NotAligned

try:
    leader.arm_when_aligned(hold_s=2.0, timeout=30.0)
except NotAligned as e:
    print(e)          # names the joint and how far out it is
```

Both `arm_when_aligned()` and `hold_deadman(True)` raise it. Releasing the
deadman never does, because a stop must not be refusable.

## Calibration

`CalibrationError` subclasses `ValueError`, so a caller that already handles bad
input keeps working.

```python theme={null}
from zeroruntime.teleops.adapters import so101_calibration

try:
    calib = so101_calibration.load_for("my_follower")
except so101_calibration.CalibrationError as e:
    print(e)          # names the path it looked in
```

## Related

<CardGroup cols={2}>
  <Card title="Troubleshooting" icon="wrench" href="/robotics/guides/troubleshooting">
    The same failures by symptom, with what to change.
  </Card>

  <Card title="Leader" icon="gamepad" href="/robotics/api-reference/python/leader">
    Arming, control and the calls that raise here.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.