Exceptions
AiriaAPIError(status_code, message, detailed_message)
Bases: Exception
Custom exception for Airia API errors.
This exception is raised when an API request to the Airia service fails. It contains both the HTTP status code and error message to help with debugging and proper error handling.
Attributes:
| Name | Type | Description |
|---|---|---|
status_code |
int
|
The HTTP status code returned by the API |
message |
str
|
The error message describing what went wrong |
Initialize the exception with a status code and error message.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
status_code
|
int
|
The HTTP status code of the failed request |
required |
message
|
str
|
A descriptive error message |
required |
Source code in airia/exceptions.py
__str__()
Return a string representation of the exception.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
A formatted string containing the status code and message |