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:
HTTPErrorBase 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
HubAPIErrorfrom 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
ErrorResponsemodel and is available using theerror_responseproperty of the returned error.- Parameters:
- r
httpx.Response The response to create a new
HubAPIErrorfor.
- r
- Returns:
HubAPIErrorA new
HubAPIErrorinstance which is enriched with information from the responser.
See also