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: PlategaError

Failed to decode/parse the API response.

exception aioplatega.exceptions.PlategaAPIError[source]#

Bases: PlategaError

Error returned by the Platega API.

The API answers failures with an envelope carrying more than a message. trace_id in 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.

  • method (str | None) – API path the request was sent to.

  • status_code (int | None) – HTTP status code.

  • 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: PlategaAPIError

HTTP 400 Bad Request.

exception aioplatega.exceptions.PlategaConflictError[source]#

Bases: PlategaAPIError

HTTP 409 Conflict.

exception aioplatega.exceptions.PlategaError[source]#

Bases: Exception

Base exception for all aioplatega errors.

exception aioplatega.exceptions.PlategaForbiddenError[source]#

Bases: PlategaAPIError

HTTP 403 Forbidden.

exception aioplatega.exceptions.PlategaNetworkError[source]#

Bases: PlategaError

Network-level error (connection refused, timeout, DNS failure, etc.).

exception aioplatega.exceptions.PlategaNotFoundError[source]#

Bases: PlategaAPIError

HTTP 404 Not Found.

exception aioplatega.exceptions.PlategaRateLimitError[source]#

Bases: PlategaAPIError

HTTP 429 Too Many Requests.

exception aioplatega.exceptions.PlategaServerError[source]#

Bases: PlategaAPIError

HTTP 5xx Server Error.

exception aioplatega.exceptions.PlategaUnauthorizedError[source]#

Bases: PlategaAPIError

HTTP 401 Unauthorized.

exception aioplatega.exceptions.PlategaUnprocessableEntityError[source]#

Bases: PlategaAPIError

HTTP 422 Unprocessable Entity.

exception aioplatega.exceptions.PlategaValidationError[source]#

Bases: PlategaError

Invalid arguments — raised before any request is sent.