Exceptions#
PlategaError
├── PlategaAPIError
│ ├── PlategaBadRequestError (400)
│ ├── PlategaUnauthorizedError (401)
│ ├── PlategaForbiddenError (403)
│ ├── PlategaNotFoundError (404)
│ ├── PlategaConflictError (409)
│ ├── PlategaUnprocessableEntityError (422)
│ ├── PlategaRateLimitError (429)
│ └── PlategaServerError (5xx)
├── PlategaNetworkError
├── PlategaValidationError
└── ClientDecodeError
Every failure raised by this library derives from PlategaError, so a single
except PlategaError is enough to catch all of them.
PlategaValidationError is raised before a request leaves the process, when
the arguments cannot form a valid request. Any other 4xx status that has no
dedicated class arrives as the generic PlategaAPIError.
Every failure this library raises.
The whole hierarchy lives in one module because it is read as one: a caller deciding what to catch wants to see the tree, not follow it across files.
- exception aioplatega.exceptions.ClientDecodeError[source]#
Bases:
PlategaErrorFailed to decode/parse the API response.
- exception aioplatega.exceptions.PlategaAPIError[source]#
Bases:
PlategaErrorError returned by the Platega API.
The API answers failures with an envelope carrying more than a message.
trace_idin particular is what Platega support asks for when investigating a request.- __init__(message, method=None, status_code=None, body=None, *, code=None, trace_id=None, errors=None)[source]#
Build the error.
- Parameters:
message (
str) – Human-readable message from the response.body (
Any) – Decoded response body, kept whole.code (
str|None) – Vendor error code, e.g."Common:VAL_0001".trace_id (
str|None) – Request identifier to quote to support.errors (
list[Any] |None) – Per-field failures, each{"key": ..., "message": ...}.
- Return type:
None
- exception aioplatega.exceptions.PlategaBadRequestError[source]#
Bases:
PlategaAPIErrorHTTP 400 Bad Request.
- exception aioplatega.exceptions.PlategaConflictError[source]#
Bases:
PlategaAPIErrorHTTP 409 Conflict.
- exception aioplatega.exceptions.PlategaError[source]#
Bases:
ExceptionBase exception for all aioplatega errors.
- exception aioplatega.exceptions.PlategaForbiddenError[source]#
Bases:
PlategaAPIErrorHTTP 403 Forbidden.
- exception aioplatega.exceptions.PlategaNetworkError[source]#
Bases:
PlategaErrorNetwork-level error (connection refused, timeout, DNS failure, etc.).
- exception aioplatega.exceptions.PlategaNotFoundError[source]#
Bases:
PlategaAPIErrorHTTP 404 Not Found.
- exception aioplatega.exceptions.PlategaRateLimitError[source]#
Bases:
PlategaAPIErrorHTTP 429 Too Many Requests.
- exception aioplatega.exceptions.PlategaServerError[source]#
Bases:
PlategaAPIErrorHTTP 5xx Server Error.
- exception aioplatega.exceptions.PlategaUnauthorizedError[source]#
Bases:
PlategaAPIErrorHTTP 401 Unauthorized.
- exception aioplatega.exceptions.PlategaUnprocessableEntityError[source]#
Bases:
PlategaAPIErrorHTTP 422 Unprocessable Entity.
- exception aioplatega.exceptions.PlategaValidationError[source]#
Bases:
PlategaErrorInvalid arguments — raised before any request is sent.