Skip to main content

LiumError

from lium.sdk import LiumError

Defined in lium.sdk.exceptions.

Base exception for Lium SDK.

code, hint and request_id come from the API's error envelope (error: \{code, message, hint, request_id\}) and the X-Request-Id header; all three are None when the server did not send them.

LiumError(
message: str = '',
*,
code: str | None = None,
hint: str | None = None,
request_id: str | None = None
)

Catching it​

LiumError subclasses Exception, so a handler for any of those also catches it.

Catching LiumError also catches ClusterNotListedError, LiumAuthError, LiumHostKeyError, LiumNotFoundError, LiumPermissionError, LiumRateLimitError, LiumServerError, PodStartError, RemoteExecutionError.

from lium.sdk import LiumError

try:
... # any SDK call
except LiumError as e:
print(e, e.code, e.hint, e.request_id)
FieldMeaning
codemachine-readable error code from the API, when it sent one
hintwhat to try next, when the API suggested something
request_idthe API request id; quote it when you contact support

Attributes​

NameTypeDescription
code
hint
request_id