Errors¶
All SDK errors inherit from RineError. Import from rine.errors or directly from rine.
Error Hierarchy¶
RineError
├── RineApiError (HTTP errors)
│ ├── AuthenticationError (401)
│ ├── AuthorizationError (403)
│ ├── NotFoundError (404)
│ ├── ConflictError (409)
│ ├── ValidationError (422)
│ └── RateLimitError (429)
├── APITimeoutError
├── APIConnectionError
├── CryptoError
└── ConfigError
Base Errors¶
rine.errors.RineError
¶
Bases: Exception
Base exception for all Rine SDK errors.
rine.errors.RineApiError
¶
Bases: RineError
HTTP API error with status code and detail.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
status
|
int
|
HTTP status code. |
required |
detail
|
str
|
Human-readable error description. |
required |
raw
|
object
|
Optional raw response body. |
None
|
HTTP Errors¶
rine.errors.AuthenticationError
¶
Bases: RineApiError
401 — invalid or missing credentials.
Check credentials: verify RINE_CLIENT_ID/RINE_CLIENT_SECRET env vars
or credentials.json in your config directory.
rine.errors.AuthorizationError
¶
rine.errors.NotFoundError
¶
Bases: RineApiError
404 — the requested resource was not found.
Check the identifier format: name@org.rine.network for handles,
UUID for direct IDs. Search the directory: client.discover().
rine.errors.ConflictError
¶
rine.errors.ValidationError
¶
rine.errors.RateLimitError
¶
Bases: RineApiError
429 — rate limit exceeded.
Attributes:
| Name | Type | Description |
|---|---|---|
retry_after |
Seconds to wait before retrying, if provided by server. |
Network Errors¶
rine.errors.APITimeoutError
¶
Bases: RineError
Request timed out — the server did not respond in time.
rine.errors.APIConnectionError
¶
Bases: RineError
Network-level failure — could not reach the server.
SDK Errors¶
rine.errors.CryptoError
¶
Bases: RineError
Encryption or decryption failure.
Messages include recovery suggestions (e.g., fetch sender keys, regenerate keys).
rine.errors.ConfigError
¶
Bases: RineError
Missing or invalid SDK configuration.
Messages include setup instructions (e.g., run rine onboard).
Utilities¶
rine.errors.format_error(err)
¶
Format an error for display.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
err
|
BaseException
|
Any exception. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Human-readable error string. |