auradefi 0.1.1
PyPI GitHub

Errors

Every exception this package raises inherits auradefi.errors.AuradefiError, so one except clause catches all of them and nothing else. Catching a narrower type is how you distinguish a caller mistake from an upstream failure.

The HTTP status column is what the API shell returns for that type. Three of them deliberately disagree with their parent: ScopeError is 403 though it subclasses a 401, CursorError is 422 though it subclasses a 500: because the status describes whose fault it is, not where the class sits.

Two error types are about the offline guarantee rather than your data: CassetteError and CassetteMissError mean a replayed recording did not contain a request. In Sandbox that means you asked for something the recording does not hold: not that a credential is missing. See Authentication & keys.

ErrorSubclass ofHTTP Raised when
AuradefiErrornone500Base class for every error raised by auradefi.
AssetConflictErrorAuradefiError500Registration would bind an existing CAIP-19 to a different asset.
AuthErrorAuradefiError401Credential or token failed authentication.
CassetteErrorAuradefiError500A cassette file is missing, malformed, or unreadable.
ConfigErrorAuradefiError500Invalid or missing configuration.
ConflictErrorAuradefiError409Create or update conflicts with existing state.
CurrencyMismatchErrorAuradefiError500Arithmetic across Money values of different currencies.
DecimalsMismatchErrorAuradefiError500Arithmetic or aggregation across quantities of unequal decimals.
DecodeErrorAuradefiError500Raw records for one transaction are mutually inconsistent or do not
LedgerErrorAuradefiError500Base class for persistence-layer failures.
NotFoundErrorAuradefiError404The entity does not exist within the caller's tenant scope.
QuotaExceededErrorAuradefiError429A tenant exhausted its quota window.
SourceErrorAuradefiError502A chain, explorer, or price source failed or returned malformed data.
UnknownAssetErrorAuradefiError500An asset id or CAIP-19 is not in the asset registry.
UnknownChainErrorAuradefiError500A chain id is syntactically valid but not in the chain registry.
ValidationErrorAuradefiError422Input failed validation before any work was attempted.
CaipParseErrorValidationError422A CAIP-2 or CAIP-19 identifier could not be parsed.
CassetteMissErrorCassetteError500An HTTP request had no matching interaction in the loaded cassette.
CursorErrorLedgerError422A sync cursor is malformed or belongs to a different ledger.
ScopeErrorAuthError403The credential lacks the scope this operation requires.
TenantIsolationErrorLedgerError500A call attempted to cross a tenant boundary.
TokenExpiredErrorAuthError401A JWT's exp (ms epoch) is in the past.
TokenRevokedErrorAuthError401A JWT's jti is in the revocation set (SPEC §7.2).

Over HTTP

Every failure is one shape, so a client parses one shape:

{
  "error": {
    "type": "ValidationError",
    "message": "request validation failed",
    "status": 422
  }
}

A 409 also carries existing_connection_id, and a 429 carries a Retry-After header in whole seconds. Source: errors.py, api/errors.py.