Structured error type returned by all Xero API operations.
All public functions return {:ok, result} or {:error, Xero.Error.t()}.
Error Types
:type | HTTP | Description |
|---|---|---|
:unauthorized | 401 | Invalid/expired access token |
:forbidden | 403 | Insufficient scope or permissions |
:not_found | 404 | Resource does not exist |
:unprocessable | 422 | Validation error |
:rate_limited | 429 | Rate limit exceeded |
:server_error | 5xx | Xero server error |
:network_error | — | Connection/timeout failure |
:config_error | — | Invalid library usage |
:oauth_error | — | OAuth token endpoint failure |
Summary
Types
@type error_type() ::
:unauthorized
| :forbidden
| :not_found
| :unprocessable
| :rate_limited
| :server_error
| :network_error
| :config_error
| :oauth_error
| :unknown
@type t() :: %Xero.Error{ __exception__: true, detail: term(), message: String.t(), raw: term(), request_id: String.t() | nil, retry_after: pos_integer() | nil, status: pos_integer() | nil, type: error_type() }