Overview
Sorionlib provides custom error classes with detailed error codes to help you handle errors effectively.Custom error classes
SorionError
Base error class for all Sorionlib errors.ApiError
Thrown by the API client for HTTP errors.DatabaseError
Thrown by database helpers for connection and query errors.ValidationError
Thrown when input validation fails.Error codes
General errors
| Code | Description |
|---|---|
UNKNOWN_ERROR | An unknown error occurred. |
INVALID_CONFIG | Configuration is invalid. |
NOT_INITIALIZED | Client not initialized. |
ALREADY_INITIALIZED | Client already initialized. |
API errors
| Code | Description |
|---|---|
NETWORK_ERROR | Network connection failed. |
TIMEOUT | Request timed out. |
UNAUTHORIZED | Authentication failed (401). |
FORBIDDEN | Access denied (403). |
NOT_FOUND | Resource not found (404). |
RATE_LIMITED | Too many requests (429). |
SERVER_ERROR | Server error (5xx). |
Database errors
| Code | Description |
|---|---|
CONNECTION_FAILED | Failed to connect to database. |
CONNECTION_LOST | Database connection lost. |
QUERY_FAILED | Query execution failed. |
DUPLICATE_KEY | Duplicate key violation. |
INVALID_QUERY | Query syntax is invalid. |
Validation errors
| Code | Description |
|---|---|
REQUIRED_FIELD | Required field is missing. |
INVALID_TYPE | Field has wrong type. |
INVALID_FORMAT | Field format is invalid. |
OUT_OF_RANGE | Value is out of allowed range. |