Skip to main content

LiumInsufficientBalanceError

from lium.sdk import LiumInsufficientBalanceError

Defined in lium.sdk.exceptions.

The account cannot pay for this (403 with a balance reason).

required and available are USD amounts when the server said what they are, else None. Callers that catch LiumPermissionError keep working; ones that want the numbers catch this class.

LiumInsufficientBalanceError(
message: str,
*,
required: float | None = None,
available: float | None = None,
code: str | None = None,
hint: str | None = None,
request_id: str | None = None
)

Catching it​

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

from lium.sdk import LiumInsufficientBalanceError

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