is_lighter_unauthorized_exception

Documentation for eth_defi.lighter.sdk.is_lighter_unauthorized_exception function.

is_lighter_unauthorized_exception(error)

Return whether an SDK exception indicates an expired or rejected token.

Lighter SDK releases have exposed the HTTP status as either status or status_code and use UnauthorizedException for the generated error type. Checking these representations keeps this adapter independent of a particular SDK release while avoiding a hard dependency on the optional lighter package.

Parameters

error (BaseException) – Exception raised by an authenticated SDK operation.

Returns

True for a Lighter HTTP 401 or UnauthorizedException.

Return type

bool