Skip to content

Errors

Exceptions raised by oxrpy.

OxfordAPIError

OxfordAPIError(message, *, status=None, code=None, body=None)

Bases: Exception

Base class for every error oxrpy raises.

Attributes:

Name Type Description
message

The API's message (or a description of what went wrong).

status

The HTTP status code, if there was a response.

code

The API's Code (e.g. "OFFLINE", "RATE_LIMITED"), if any.

body

The decoded JSON body, if there was one.

AuthenticationError

AuthenticationError(message, *, status=None, code=None, body=None)

Bases: OxfordAPIError

401/403: missing or invalid server key, missing API package, or a bad/suspended app key.

BadRequestError

BadRequestError(message, *, status=None, code=None, body=None)

Bases: OxfordAPIError

400: an unknown parameter, a bad value, or a malformed command body.

valid_parameters lists every parameter GET /v1/server accepts, when the API sends it.

NotFoundError

NotFoundError(message, *, status=None, code=None, body=None)

Bases: OxfordAPIError

404: no such endpoint, or no command with that id (results are kept for 7 days).

EndpointRemovedError

EndpointRemovedError(message, *, status=None, code=None, body=None)

Bases: OxfordAPIError

410: a deprecated endpoint that has been removed.

RateLimitError

RateLimitError(message, *, retry_after=None, **kwargs)

Bases: OxfordAPIError

429: rate limited, and the retries ran out.

retry_after is the number of seconds the API asked us to wait.

ServerOfflineError

ServerOfflineError(message, *, status=None, code=None, body=None)

Bases: OxfordAPIError

503: the server is offline, so the command could not be run.

CommandFailedError

CommandFailedError(result)

Bases: OxfordAPIError

A command reached the server but did not succeed (only raised with check=True).

result is the full command result (CommandId, Status, Code, Message).