Errors

Both SDKs map gRPC/Connect status codes into typed OLO SDK errors. Platform Connect failures may also set reason from the olo-error-reason header.

Typed errors mapped from grpc.RpcError and Connect failures.

exception olo.errors.OloAmbiguousNamespace[source]

Bases: OloError

exception olo.errors.OloAmbiguousPlanningGroup[source]

Bases: OloError

exception olo.errors.OloError[source]

Bases: Exception

__init__(message, code=None, details=None, *, reason=None)[source]

Create an error with optional gRPC/Connect code, details, and reason.

Parameters:
  • message (str)

  • code (int | None)

  • details (str | None)

  • reason (str | None)

exception olo.errors.OloFailedPrecondition[source]

Bases: OloError

exception olo.errors.OloInternalError[source]

Bases: OloError

exception olo.errors.OloInvalidArgument[source]

Bases: OloError

exception olo.errors.OloNotFound[source]

Bases: OloError

exception olo.errors.OloPermissionDenied[source]

Bases: OloError

exception olo.errors.OloPlatformNotConfigured[source]

Bases: OloError

exception olo.errors.OloTimeoutError[source]

Bases: OloError

exception olo.errors.OloUnauthenticated[source]

Bases: OloError

exception olo.errors.OloUnavailable[source]

Bases: OloError

olo.errors.wrap_connect_error(code, message, *, reason=None)[source]

Map a Connect error code string to a typed OloError.

Return type:

OloError

Parameters:
  • code (str)

  • message (str)

  • reason (str | None)

olo.errors.wrap_rpc_error(exc)[source]

Map a grpc.RpcError to a typed OloError.

Return type:

OloError

Parameters:

exc (RpcError)

RPC failures are mapped from Connect/gRPC status codes to typed OloError subclasses.

Base types

  • OloError — base class for all SDK errors.

  • OloErrorOptions — metadata attached to an SDK error.

  • wrapRpcError — map thrown values to typed SDK errors.

Typed errors