Exceptions
- class flame_hub._exceptions.ErrorResponse(*, statusCode: int, code: str, message: str, **extra_data: Any)
Bases:
BaseModel
- model_config: ClassVar[ConfigDict] = {'extra': 'allow'}
Configuration so that extra properties may be available.
- class flame_hub.HubAPIError(message: str, request: Request, error: ErrorResponse = None)
Bases:
HTTPError
Base error for any unexpected response returned by the Hub API.
- Parameters:
- message
str
The error message.
- request
httpx.Request
The request which caused the error.
- error
ErrorResponse
, optional Parsed response to enrich the error with additional information.
- message
See also
- flame_hub._exceptions.new_hub_api_error_from_response(r: Response) HubAPIError
Create a new
HubAPIError
from a response.If present, this function will use the response body to add context to the error message. The response body is parsed by the
ErrorResponse
model and is available using theerror_response
property of the returned error.- Parameters:
- r
httpx.Response
The response to create a new
HubAPIError
for.
- r
- Returns:
HubAPIError
A new
HubAPIError
instance which is enriched with information from the responser
.
See also