roboto.exceptions#

Submodules#

Package Contents#

exception roboto.exceptions.ClientError(exc)#

Bases: HttpError

Common base class for all non-exit exceptions.

Parameters:

exc (urllib.error.HTTPError)

exception roboto.exceptions.HttpError(exc)#

Bases: Exception

Common base class for all non-exit exceptions.

Parameters:

exc (urllib.error.HTTPError)

property headers: dict#
Return type:

dict

property msg: Any#
Return type:

Any

property status: http.HTTPStatus | None#
Return type:

Optional[http.HTTPStatus]

exception roboto.exceptions.RobotoConditionException(message, stack_trace=[], headers={}, *args, **kwargs)#

Bases: RobotoDomainException

Thrown if there is a failed condition

Parameters:
  • message (str)

  • stack_trace (list[str])

  • headers (dict[str, str])

property http_status_code: int#
Return type:

int

exception roboto.exceptions.RobotoConflictException(message, stack_trace=[], headers={}, *args, **kwargs)#

Bases: RobotoDomainException

Thrown if there is a conflict between a resource you’re creating and another existing resource

Parameters:
  • message (str)

  • stack_trace (list[str])

  • headers (dict[str, str])

property http_status_code: int#
Return type:

int

exception roboto.exceptions.RobotoDeprecatedException(message, stack_trace=[], headers={}, *args, **kwargs)#

Bases: RobotoDomainException

Thrown when an old API endpoint is called, to tell the client to upgrade

Parameters:
  • message (str)

  • stack_trace (list[str])

  • headers (dict[str, str])

property http_status_code: int#
Return type:

int

exception roboto.exceptions.RobotoDomainException(message, stack_trace=[], headers={}, *args, **kwargs)#

Bases: Exception

Expected exceptions from the Roboto domain entity objects.

Parameters:
  • message (str)

  • stack_trace (list[str])

  • headers (dict[str, str])

property error_code: str#
Return type:

str

static from_client_error(error)#
Parameters:

error (roboto.exceptions.http.HttpError)

Return type:

RobotoDomainException

static from_json(contents, headers={})#
Parameters:
  • contents (dict[str, Any])

  • headers (dict[str, str])

Return type:

RobotoDomainException

static from_json_string(contents)#
Parameters:

contents (str)

Return type:

RobotoDomainException

property headers: dict[str, str]#
Return type:

dict[str, str]

property http_status_code: int#
Return type:

int

property message: str#
Return type:

str

serialize()#
Return type:

str

property stack_trace: list[str]#
Return type:

list[str]

to_dict()#
Return type:

dict[str, Any]

exception roboto.exceptions.RobotoExpiredException(message, stack_trace=[], headers={}, *args, **kwargs)#

Bases: RobotoDomainException

Thrown if a resource is missing or expired.

Parameters:
  • message (str)

  • stack_trace (list[str])

  • headers (dict[str, str])

property http_status_code: int#
Return type:

int

exception roboto.exceptions.RobotoFailedToGenerateException(message, stack_trace=[], headers={}, *args, **kwargs)#

Bases: RobotoDomainException

Thrown when Roboto fails to generate a resource due to an internal error.

Parameters:
  • message (str)

  • stack_trace (list[str])

  • headers (dict[str, str])

property http_status_code: int#
Return type:

int

class roboto.exceptions.RobotoHttpExceptionParse#

Bases: object

exception roboto.exceptions.RobotoIllegalArgumentException(message, stack_trace=[], headers={}, *args, **kwargs)#

Bases: RobotoDomainException

Thrown when request parameters are in some way invalid

Parameters:
  • message (str)

  • stack_trace (list[str])

  • headers (dict[str, str])

property http_status_code: int#
Return type:

int

exception roboto.exceptions.RobotoInternalException(message, stack_trace=[], headers={}, *args, **kwargs)#

Bases: RobotoDomainException

Thrown when Roboto throws an unexpected internal error, expected to be systemic.

Parameters:
  • message (str)

  • stack_trace (list[str])

  • headers (dict[str, str])

property http_status_code: int#
Return type:

int

exception roboto.exceptions.RobotoInvalidRequestException(message, stack_trace=[], headers={}, *args, **kwargs)#

Bases: RobotoDomainException

Thrown when request parameters are in some way invalid

Parameters:
  • message (str)

  • stack_trace (list[str])

  • headers (dict[str, str])

property http_status_code: int#
Return type:

int

exception roboto.exceptions.RobotoInvalidStateTransitionException(message, stack_trace=[], headers={}, *args, **kwargs)#

Bases: RobotoDomainException

Thrown when requesting update of state to an invalid state, or via an invalid transition path

Parameters:
  • message (str)

  • stack_trace (list[str])

  • headers (dict[str, str])

property http_status_code: int#
Return type:

int

exception roboto.exceptions.RobotoLimitExceededException(message, stack_trace=[], *args, resource_name='Unknown', current_quantity=0, limit_quantity=0, **kwargs)#

Bases: RobotoDomainException

Thrown if an operation would exceed a user or org level limit.

Parameters:
  • message (str)

  • stack_trace (list[str])

  • resource_name (str)

  • current_quantity (int)

  • limit_quantity (int)

property current_quantity: int#
Return type:

int

property http_status_code: int#
Return type:

int

property limit_quantity: int#
Return type:

int

property resource_name: str#
Return type:

str

to_dict()#
Return type:

dict[str, Any]

exception roboto.exceptions.RobotoNoOrgProvidedException(message, stack_trace=[], headers={}, *args, **kwargs)#

Bases: RobotoDomainException

Thrown when no org is provided to an operation which requires an org.

Parameters:
  • message (str)

  • stack_trace (list[str])

  • headers (dict[str, str])

property http_status_code: int#
Return type:

int

exception roboto.exceptions.RobotoNotFoundException(message, stack_trace=[], headers={}, *args, **kwargs)#

Bases: RobotoDomainException

Throw when a requested resource does not exist

Parameters:
  • message (str)

  • stack_trace (list[str])

  • headers (dict[str, str])

property http_status_code: int#
Return type:

int

exception roboto.exceptions.RobotoNotImplementedException(message, stack_trace=[], headers={}, *args, **kwargs)#

Bases: RobotoDomainException

Thrown by shimmed out APIs which have not yet been implemented

Parameters:
  • message (str)

  • stack_trace (list[str])

  • headers (dict[str, str])

property http_status_code: int#
Return type:

int

exception roboto.exceptions.RobotoNotReadyException(message, stack_trace=[], headers={}, *args, **kwargs)#

Bases: RobotoDomainException

Throw when a requested resource is resolvable by ID/context but is not fully initialized or ready to be served.

Parameters:
  • message (str)

  • stack_trace (list[str])

  • headers (dict[str, str])

property http_status_code: int#
Return type:

int

exception roboto.exceptions.RobotoServiceException(message, stack_trace=[], headers={}, *args, **kwargs)#

Bases: RobotoDomainException

Thrown when Roboto Service failed in an unexpected way

Parameters:
  • message (str)

  • stack_trace (list[str])

  • headers (dict[str, str])

exception roboto.exceptions.RobotoServiceUnavailableException(message, stack_trace=[], headers={}, *args, **kwargs)#

Bases: RobotoDomainException

Thrown when a service is unavailable, such as when it’s under heavy load and can’t accept new requests. This is expected to be transient and ought to be retried.

Parameters:
  • message (str)

  • stack_trace (list[str])

  • headers (dict[str, str])

property http_status_code: int#
Return type:

int

exception roboto.exceptions.RobotoUnauthorizedException(message, stack_trace=[], headers={}, *args, **kwargs)#

Bases: RobotoDomainException

Thrown when a user is attempting to access a resource that they do not have permission to access

Parameters:
  • message (str)

  • stack_trace (list[str])

  • headers (dict[str, str])

property http_status_code: int#
Return type:

int

exception roboto.exceptions.RobotoUnknownOperationException(message, stack_trace=[], headers={}, *args, **kwargs)#

Bases: RobotoDomainException

Thrown if a user is attempting to perform an action unrecognized by the Roboto platform.

Parameters:
  • message (str)

  • stack_trace (list[str])

  • headers (dict[str, str])

property http_status_code: int#
Return type:

int

exception roboto.exceptions.ServerError(exc)#

Bases: HttpError

Common base class for all non-exit exceptions.

Parameters:

exc (urllib.error.HTTPError)