ovok_sdk.errors
Errors the SDK raises, one class per kind of failure.
- Stable unknown
- Release candidate since 0.1.0-rc.4
- Development since 0.1.0-dev.25+2ba84b0
Errors the SDK raises, one class per kind of failure.
FieldError
FieldError(
message: str,
path: tuple[str, ...] = (),
code: str | None = None,
validation: str | None = None,
)One invalid part of a request, named by its path.
Attributes
| Name | Type | Description |
|---|---|---|
message | str | What is wrong with the value. |
path | tuple[str, ...] | Location of the value in the request body, such as ("name", "0"). |
code | str | None | Machine-readable error code, when the API sends one. |
validation | str | None | Name of the failed validation rule, when the API sends one. |
OvokErrorDetails
OvokErrorDetails(
message: str,
status: int | None = None,
code: str | None = None,
type: str | None = None,
trace_id: str | None = None,
request_id: str | None = None,
retry_after_ms: int | None = None,
field_errors: tuple[FieldError, ...] = (),
)Everything known about one failure; the fields of an OvokError.
Attributes
| Name | Type | Description |
|---|---|---|
message | str | Human-readable description. |
status | int | None | HTTP status, or None when no response arrived. |
code | str | None | Machine-readable error code from the response. |
type | str | None | Error type from the response. |
trace_id | str | None | Server trace ID; quote it when reporting the failure. |
request_id | str | None | Server request ID. |
retry_after_ms | int | None | How long to wait before retrying, from Retry-After. |
field_errors | tuple[FieldError, ...] | Invalid parts of the request. |
OvokError
OvokError(details: OvokErrorDetails)Bases: Exception
Every SDK failure; quote trace_id when reporting one.
Catch this class to handle any SDK error. Its attributes copy OvokErrorDetails.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
details | OvokErrorDetails | Everything known about the failure. |
Attributes
| Name | Type | Description |
|---|---|---|
message | Human-readable description. | |
status | HTTP status, or None when no response arrived. | |
code | Machine-readable error code from the response. | |
type | Error type from the response. | |
trace_id | Server trace ID. | |
request_id | Server request ID. | |
retry_after_ms | How long to wait before retrying, from Retry-After. | |
field_errors | Invalid parts of the request. |
OvokValidationError
OvokValidationError()Bases: OvokError
The request was malformed or failed validation (400, 422).
OvokAuthenticationError
OvokAuthenticationError()Bases: OvokError
Credentials are missing, invalid or expired (401).
OvokPermissionError
OvokPermissionError()Bases: OvokError
The caller is signed in but not allowed to do this (403).
OvokNotFoundError
OvokNotFoundError()Bases: OvokError
The resource does not exist (404).
OvokConflictError
OvokConflictError()Bases: OvokError
The request conflicts with the current state, such as a duplicate (409).
OvokRateLimitError
OvokRateLimitError()Bases: OvokError
Too many requests (429); wait retry_after_ms before retrying.
OvokServiceError
OvokServiceError()Bases: OvokError
The server failed or was unavailable (5xx).
OvokConnectionError
OvokConnectionError()Bases: OvokError
No response arrived: the connection failed or timed out.
OvokConfigError
OvokConfigError()Bases: OvokError
A client option is invalid; raised when the client is constructed.
error_for_status()
error_for_status(details: OvokErrorDetails) -> OvokErrorBuild the OvokError subclass that matches details.status.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
details | OvokErrorDetails | The failure, with its HTTP status. |
Returns
OvokError:OvokServiceErrorfor 5xx, a status-specific class where one exists, elseOvokError.
Last updated on