Skip to content

Exceptions🔗

The earthdaily.earthone.exceptions module defines a hierarchy of exceptions for handling EarthOne API errors.

exceptions 🔗

Exceptions raised by HTTP clients.

ClientError 🔗

Bases: Exception

Base class for all client exceptions.

Source code in earthdaily/earthone/exceptions.py
class ClientError(Exception):
    """Base class for all client exceptions."""

    pass

AuthError 🔗

Bases: ClientError

Authentication error, improperly supplied credentials.

Source code in earthdaily/earthone/exceptions.py
class AuthError(ClientError):
    """Authentication error, improperly supplied credentials."""

    pass

OauthError 🔗

Bases: AuthError

Authentication error, failure from OAuth authentication service.

Source code in earthdaily/earthone/exceptions.py
class OauthError(AuthError):
    """Authentication error, failure from OAuth authentication service."""

    pass

ConfigError 🔗

Bases: Exception

Configuration error during initial configuration of the library.

Source code in earthdaily/earthone/exceptions.py
class ConfigError(Exception):
    """Configuration error during initial configuration of the library."""

    pass

ServerError 🔗

Bases: Exception

Server or service failure.

Source code in earthdaily/earthone/exceptions.py
class ServerError(Exception):
    """Server or service failure."""

    status = 500

BadRequestError 🔗

Bases: ClientError

Client request with incorrect parameters.

Source code in earthdaily/earthone/exceptions.py
class BadRequestError(ClientError):
    """Client request with incorrect parameters."""

    status = 400

UnauthorizedError 🔗

Bases: ClientError

Client request lacking authentication.

Source code in earthdaily/earthone/exceptions.py
class UnauthorizedError(ClientError):
    """Client request lacking authentication."""

    status = 401

ForbiddenError 🔗

Bases: ClientError

Client request lacks necessary permissions.

Source code in earthdaily/earthone/exceptions.py
class ForbiddenError(ClientError):
    """Client request lacks necessary permissions."""

    status = 403

NotFoundError 🔗

Bases: ClientError

Resource not found.

Source code in earthdaily/earthone/exceptions.py
class NotFoundError(ClientError):
    """Resource not found."""

    status = 404

MethodNotAllowedError 🔗

Bases: ClientError

Requested nethod not supported by the resource.

Source code in earthdaily/earthone/exceptions.py
class MethodNotAllowedError(ClientError):
    """Requested nethod not supported by the resource."""

    status = 405

ProxyAuthenticationRequiredError 🔗

Bases: ClientError

Client request needs proxy authentication.

Attributes🔗

status : int The status code of the error response. proxy_authenticate : Optional[str] A ProxyAuthenticate <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authenticate>_ header if found in the response.

Source code in earthdaily/earthone/exceptions.py
class ProxyAuthenticationRequiredError(ClientError):
    """Client request needs proxy authentication.

    Attributes
    ==========
    status : int
        The status code of the error response.
    proxy_authenticate : Optional[str]
        A `ProxyAuthenticate <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authenticate>`_
        header if found in the response.
    """

    status = 407

    def __init__(self, message, proxy_authenticate=None) -> None:
        super(ProxyAuthenticationRequiredError, self).__init__(message)

        self.proxy_authenticate = proxy_authenticate

ConflictError 🔗

Bases: ClientError

Client request conflicts with existing state.

Source code in earthdaily/earthone/exceptions.py
class ConflictError(ClientError):
    """Client request conflicts with existing state."""

    status = 409

GoneError 🔗

Bases: ClientError

Client request to a URL which has been permanently removed.

Source code in earthdaily/earthone/exceptions.py
class GoneError(ClientError):
    """Client request to a URL which has been permanently removed."""

    status = 410

ValidationError 🔗

Bases: BadRequestError

Client request with invalid parameters.

Source code in earthdaily/earthone/exceptions.py
class ValidationError(BadRequestError):
    """Client request with invalid parameters."""

    status = 422

RateLimitError 🔗

Bases: ClientError

Client request exceeds rate limits.

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

Source code in earthdaily/earthone/exceptions.py
class RateLimitError(ClientError):
    """
    Client request exceeds rate limits.

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

    status = 429

    def __init__(self, message, retry_after=None):
        """
        Construct a new instance.

        :param str message: The error message.
        :type retry_after: str or None
        :param retry_after: An indication of a
            ``retry-after`` timeout specified by the error response.
        """
        super(RateLimitError, self).__init__(message)
        self.retry_after = retry_after

__init__ 🔗

__init__(message, retry_after=None)

Construct a new instance.

:param str message: The error message. :type retry_after: str or None :param retry_after: An indication of a retry-after timeout specified by the error response.

Source code in earthdaily/earthone/exceptions.py
def __init__(self, message, retry_after=None):
    """
    Construct a new instance.

    :param str message: The error message.
    :type retry_after: str or None
    :param retry_after: An indication of a
        ``retry-after`` timeout specified by the error response.
    """
    super(RateLimitError, self).__init__(message)
    self.retry_after = retry_after

RetryWithError 🔗

Bases: ClientError

Vector service query request timed out.

Source code in earthdaily/earthone/exceptions.py
class RetryWithError(ClientError):
    """Vector service query request timed out."""

    status = 449

GatewayTimeoutError 🔗

Bases: ServerError

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

Source code in earthdaily/earthone/exceptions.py
class GatewayTimeoutError(ServerError):
    """Timeout from the gateway after failing to route request to destination service."""

    status = 504

RequestCancellationError 🔗

Bases: ClientError

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

Source code in earthdaily/earthone/exceptions.py
class RequestCancellationError(ClientError):
    """Client cancelled the request and no status or response was received."""