# Error codes

> Stable error codes, what they mean, and whether a retry is safe.

Error codes are stable identifiers. Branch on `error.code`, not on the human message — the message text may change between releases.

## Catalog

| Code | Meaning | Retryable |
| --- | --- | --- |
| E_UNAUTHENTICATED | No valid session. | No |
| E_PERMISSION_DENIED | The caller lacks the required scope. | No |
| E_RATE_LIMITED | Too many requests in the window. | Yes, after reset |
| E_RUNTIME_UNAVAILABLE | Yalla Runtime is temporarily unavailable. | Yes |
| E_INTERNAL | An unexpected server error occurred. | Yes |

## Handle an error in a script

**Branch on the stable code, never the message**

```bash
code=$(yalla deploy --env staging --json | jq -r '.error.code // empty')
if [ "$code" = "E_RATE_LIMITED" ]; then
  sleep 30
  yalla deploy --env staging --json
fi
```

> [!WARNING]
> A retryable code is safe to retry with backoff. Non-retryable codes need a corrective action first.
