The following exception classes may be raised by Descartes Labs client APIs when an error in a client request is encountered.

descarteslabs.exceptions

Exceptions raised by HTTP clients.

HTTP Exceptions

Exceptions raised by HTTP clients.

exception AuthError[source]

Bases: ClientError

Authentication error, improperly supplied credentials.

exception BadRequestError[source]

Bases: ClientError

Client request with incorrect parameters.

status = 400
exception ClientError[source]

Bases: Exception

Base class for all client exceptions.

exception ConfigError[source]

Bases: Exception

Configuration error during initial configuration of the library.

exception ConflictError[source]

Bases: ClientError

Client request conflicts with existing state.

status = 409
exception ForbiddenError[source]

Bases: ClientError

Client request lacks necessary permissions.

status = 403
exception GatewayTimeoutError[source]

Bases: ServerError

Timeout from the gateway after failing to route request to destination service.

status = 504
exception GoneError[source]

Bases: ClientError

Client request to a URL which has been permanently removed.

status = 410
exception MethodNotAllowedError[source]

Bases: ClientError

Requested nethod not supported by the resource.

status = 405
exception NotFoundError[source]

Bases: ClientError

Resource not found.

status = 404
exception OauthError[source]

Bases: AuthError

Authentication error, failure from OAuth authentication service.

exception ProxyAuthenticationRequiredError(message, proxy_authenticate=None)[source]

Bases: ClientError

Client request needs proxy authentication.

status

The status code of the error response.

Type:

int

proxy_authenticate

A ProxyAuthenticate header if found in the response.

Type:

Optional[str]

status = 407
exception RateLimitError(message, retry_after=None)[source]

Bases: ClientError

Client request exceeds rate limits.

The retry_after member will contain any time limit returned in the response.

Construct a new instance.

Parameters:
  • message (str) – The error message.

  • retry_after (str or None) – An indication of a retry-after timeout specified by the error response.

status = 429
exception RequestCancellationError[source]

Bases: ClientError

Client cancelled the request and no status or response was received.

exception RetryWithError[source]

Bases: ClientError

Vector service query request timed out.

status = 449
exception ServerError[source]

Bases: Exception

Server or service failure.

status = 500
exception UnauthorizedError[source]

Bases: ClientError

Client request lacking authentication.

status = 401
exception ValidationError[source]

Bases: BadRequestError

Client request with invalid parameters.

status = 422