Skip to main content

LiumSessionError

from lium.sdk import LiumSessionError

Defined in lium.sdk.exceptions.

A browser session (lium workspaces login / LIUM_SESSION_TOKEN) is missing or refused.

An API key cannot fix this, so the CLI's hint must not point at one.

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

Catching it​

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

Catching LiumSessionError also catches LiumTwoFactorRequired.

from lium.sdk import LiumSessionError

try:
... # any SDK call
except LiumSessionError 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