Errors
| Exception | Raised when | Attributes |
|---|---|---|
ArrektaError | the node or gateway returns an error (RFC 9457 application/problem+json) | status, code, title, detail |
TransportError (a ArrektaError) | the request never got an HTTP answer (connection, timeout) | detail |
DecodeError | bytes don't decode (transaction, PST, address, …) | message |
ValidationError | a local consensus or policy check fails | code |
ValueError | an amount string is malformed or has too many decimals | message |
Branch on code; codes are stable and listed in the error code reference.
from arrekta_sdk import ArrektaError
try:
client.send_transaction(tx=signed)
except ArrektaError as e:
if e.code == "insufficient-fee":
... # bump the fee
else:
raiseHTTP statuses: 400 bad encoding, 404 not found, 409 policy rejection, 422 consensus violation, 429 rate limited. See the error model.