Error codes
Errors follow Connect’s status-code conventions, which map cleanly onto HTTP. The SDK surfaces typed error classes; raw HTTP callers get the matching status.
| Code | Meaning | Typical cause |
|---|---|---|
unauthenticated (401) | Missing or invalid token | No Authorization header, expired token, revoked token |
permission_denied (403) | Authenticated but not allowed | Read-only token attempting a write; cross-workspace access |
not_found (404) | Repo or path doesn’t exist | Wrong slug, wrong ref, missing file |
already_exists (409) | Slug taken | Creating a repo with an existing slug in the same workspace |
failed_precondition (412) | Optimistic-concurrency check failed | expected_head doesn’t match current ref |
resource_exhausted (429) | Rate limit or lease contention | Too many writes to the same branch from many writers |
internal (500) | Server-side error | Genuine bug — please tell us |
Detailed handling notes per code are in flight.