errors
Api errors.
Classes:
| Name | Description |
|---|---|
ApiError |
Exception raised when an API request fails. |
NotSavedError |
Exception raised when the object was not saved into database prior to the current operation. |
Functions:
| Name | Description |
|---|---|
handle_api_validation_errors |
Raise HTTPValidationError in case the call to API return such response. |
retry_on_exception |
Retry function on certain exceptions. |
Attributes:
| Name | Type | Description |
|---|---|---|
logger |
|
logger = logging.getLogger(__name__)
#
ApiError(message: str)
#
NotSavedError(message: str)
#
handle_api_validation_errors(api_call_result: T | HTTPValidationError | None) -> T
#
Raise HTTPValidationError in case the call to API return such response.
Source code in src/xpdeep/utils/errors.py
retry_on_exception(exception_types: tuple[type[Exception], ...], max_retries: int = 10) -> Callable[[F], F]
#
Retry function on certain exceptions.
For instance:
httpx.RemoteProtocolError: peer closed connection without sending complete message body (incomplete chunked read)
We should retry the function.