runzero.client.errors

all client errors listed here

Module Contents

Classes

ErrInfo

runZero's implementation of RFC7807 JSON error description

exception runzero.client.errors.AuthError[source]

Bases: runzero.errors.APIError

AuthError is a named Exception class for authentication issues with the runZero SDK client

Common types of authentication issues are: * Incorrect credentials * Misconfigured credentials * Missing credentials

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

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception runzero.client.errors.ClientError(message: str | None = None, unparsed_response: str | None = None, error_info: ErrInfo | None = None)[source]

Bases: runzero.errors.APIError

ClientError is a named Exception class for holding 400 level http status code messages.

Parameters:
  • error_info (ErrInfo) – ErrInfo, optional which holds message data parsed from the server’s response.

  • unparsed_response (str, optional) – a string which holds the unparsed response body.

  • message (Optional[str]) – A top-level error description. The default value None provides a reasonable message.

Constructor method

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception runzero.client.errors.CommunicationError[source]

Bases: runzero.errors.Error

CommunicationError is a named Exception class raised when an API request to runZero service cannot complete due to a protocol-level error.

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

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception runzero.client.errors.ConnError[source]

Bases: runzero.errors.Error, ConnectionError

ConnError is a named Exception class raised when an API request to runZero service cannot complete due to a packet-level error.

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

class errno

POSIX exception code

class filename

exception filename

class filename2

second exception filename

class strerror

exception strerror

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception runzero.client.errors.ConnTimeoutError[source]

Bases: runzero.errors.Error, TimeoutError

ConnTimeoutError is a named Exception class raised when an API request to runZero service cannot complete due a failure to create or maintain a connection to a runZero resource. The timeout value of the Client can be adjusted.

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

class errno

POSIX exception code

class filename

exception filename

class filename2

second exception filename

class strerror

exception strerror

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class runzero.client.errors.ErrInfo(detail: str, status: int, title: str)[source]

Bases: runzero.types.errors.RFC7807Error

runZero’s implementation of RFC7807 JSON error description

detail: str | None

A human readable explanation specific to this occurrence of the problem that is helpful to locate the problem and give advice on how to proceed. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.

status: int | None

The HTTP status code generated by the origin server for this occurrence of the problem.

title: str | None

A short summary of the problem type. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.

exception runzero.client.errors.RateLimitError(rate_limit_information: runzero.types.RateLimitInformation, message: str | None = None, unparsed_response: str | None = None)[source]

Bases: runzero.errors.APIError

RateLimitError is a named Exception class errors resulting from API rate limiting.

See https://www.runzero.com/docs/leveraging-the-api/#api-client-credentials for details.

Consider an exponential backoff retry, or a more calculated approach by examining the returned numbers.

Parameters:
  • message (Optional[str]) – A top-level error description. The default value None provides a reasonable message.

  • unparsed_response (str, optional) – optional string which holds the unparsed response body.

  • rate_limit_information (RateLimitInformation) – a RateLimitInformation object which holds the rate limit data

Constructor method

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception runzero.client.errors.ServerError(message: str | None = None, unparsed_response: str | None = None, error_info: ErrInfo | None = None)[source]

Bases: runzero.errors.APIError

ServerError is a named Exception class for holding 500 level http status code messages.

A ServerError indicates nothing about the way the request was performed. The server cannot complete the task. You should retry or abort.

Parameters:
  • error_info (ErrInfo) – ErrInfo, optional which holds message data parsed from the server’s response.

  • message (Optional[str]) – A top-level error description. The default value None provides a reasonable message.

  • unparsed_response (str, optional) – optional string which holds the unparsed response body.

Constructor method

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception runzero.client.errors.UnknownAPIError(message: str | None = None, unparsed_response: str | None = None)[source]

Bases: runzero.errors.APIError

UnknownAPIError is a named Exception class raised when the response indicates a structured error message that cannot be parsed.

Effort is made to receive and interpret errors returned from runZero services. These errors should be rare to non-existent.

Parameters:
  • message (Optional[str]) – A top-level error description. The default value None provides a reasonable message.

  • unparsed_response (str, optional) – optional string which holds the unparsed response body.

Constructor method

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception runzero.client.errors.UnsupportedRequestError(message: str)[source]

Bases: ValueError, runzero.errors.Error

UnsupportedRequestError is a named Exception class representing any Error from the runZero API which cannot be properly interpreted into a friendlier form.

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

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.