nemo_microservices._exceptions#

Module Contents#

API#

exception nemo_microservices._exceptions.APIConnectionError(
*,
message: str = 'Connection error.',
request: httpx.Request,
)#

Bases: nemo_microservices._exceptions.APIError

exception nemo_microservices._exceptions.APIError(message: str, request: httpx.Request, *, body: object | None)#

Bases: nemo_microservices._exceptions.NeMoMicroservicesError

body: object | None#

None

The API response body.

If the API responded with a valid JSON structure then this property will be the decoded result.

If it isn’t a valid JSON structure then this will be the raw response.

If there was no response associated with this error then it will be None.

message: str#

None

request: httpx.Request#

None

exception nemo_microservices._exceptions.APIResponseValidationError(
response: httpx.Response,
body: object | None,
*,
message: str | None = None,
)#

Bases: nemo_microservices._exceptions.APIError

response: httpx.Response#

None

status_code: int#

None

exception nemo_microservices._exceptions.APIStatusError(
message: str,
*,
response: httpx.Response,
body: object | None,
)#

Bases: nemo_microservices._exceptions.APIError

Raised when an API response has a status code of 4xx or 5xx.

Initialization

Initialize self. See help(type(self)) for accurate signature.

response: httpx.Response#

None

status_code: int#

None

exception nemo_microservices._exceptions.APITimeoutError(request: httpx.Request)#

Bases: nemo_microservices._exceptions.APIConnectionError

exception nemo_microservices._exceptions.AuthenticationError(
message: str,
*,
response: httpx.Response,
body: object | None,
)#

Bases: nemo_microservices._exceptions.APIStatusError

status_code: typing_extensions.Literal[401]#

401

exception nemo_microservices._exceptions.BadRequestError(
message: str,
*,
response: httpx.Response,
body: object | None,
)#

Bases: nemo_microservices._exceptions.APIStatusError

status_code: typing_extensions.Literal[400]#

400

exception nemo_microservices._exceptions.ConflictError(
message: str,
*,
response: httpx.Response,
body: object | None,
)#

Bases: nemo_microservices._exceptions.APIStatusError

status_code: typing_extensions.Literal[409]#

409

exception nemo_microservices._exceptions.InternalServerError(
message: str,
*,
response: httpx.Response,
body: object | None,
)#

Bases: nemo_microservices._exceptions.APIStatusError

exception nemo_microservices._exceptions.NeMoMicroservicesError#

Bases: Exception

exception nemo_microservices._exceptions.NotFoundError(
message: str,
*,
response: httpx.Response,
body: object | None,
)#

Bases: nemo_microservices._exceptions.APIStatusError

status_code: typing_extensions.Literal[404]#

404

exception nemo_microservices._exceptions.PermissionDeniedError(
message: str,
*,
response: httpx.Response,
body: object | None,
)#

Bases: nemo_microservices._exceptions.APIStatusError

status_code: typing_extensions.Literal[403]#

403

exception nemo_microservices._exceptions.RateLimitError(
message: str,
*,
response: httpx.Response,
body: object | None,
)#

Bases: nemo_microservices._exceptions.APIStatusError

status_code: typing_extensions.Literal[429]#

429

exception nemo_microservices._exceptions.UnprocessableEntityError(
message: str,
*,
response: httpx.Response,
body: object | None,
)#

Bases: nemo_microservices._exceptions.APIStatusError

status_code: typing_extensions.Literal[422]#

422