LiumScopeError
from lium.sdk import LiumScopeError
Defined in lium.sdk.exceptions.
The API key lacks the scope the route needs (403 API key '<name>' does not have the '<scope>' scope).
scope is the missing scope (read, rent, manage, billing) when the server named it,
else None. Another key with that scope fixes this, not funds or verification.
LiumScopeError(
message: str,
*,
scope: str | None = None,
code: str | None = None,
hint: str | None = None,
request_id: str | None = None
)
Catching it
LiumScopeError subclasses LiumPermissionError → LiumError → Exception, so a handler for any of those also catches it.
from lium.sdk import LiumScopeError
try:
... # any SDK call
except LiumScopeError as e:
print(e, e.code, e.hint, e.request_id)
| Field | Meaning |
|---|---|
code | machine-readable error code from the API, when it sent one |
hint | what to try next, when the API suggested something |
request_id | the API request id; quote it when you contact support |
Attributes
| Name | Type | Description |
|---|---|---|
scope |