Reference

[ AxiomCore · Documentation ]

Runtime errors

Structured client runtime errors, their stages, categories, codes, and retry rules, plus typed failures and ADB database lifecycle codes.

When a request through the Axiom runtime fails, you get a structured AxiomError instead of a bare exception. This page lists its fields and values, how to handle them, typed business failures, and the ADB codes the database commands print.

The AxiomError object

FieldMeaning
stageThe pipeline boundary where the failure happened
categoryA broad class for UI, metrics, and policy decisions
codeThe specific condition. An HTTP failure carries its status number
messageA human-readable summary that is safe for application handling
retryableThe runtime's assessment of whether another attempt may succeed
detailsOptional extra context, such as field validation messages
sourceOptional internal source context; bindings may omit it

Match on code or category, never on message. Keep an unknown fallback so a newer runtime does not break an older UI.

How each binding exposes the object:

BindingShape
Web (atmx-web)Errors from the engine use the names on this page: stage such as "ContractLoad", category such as "Auth", and code such as "ContractInvalid", or an object for HTTP statuses: { "HttpStatus": 404 }. Errors raised by the JavaScript layer use lower-camel-case stage and category values ("ffiBoundary", "runtime", "network") and their own codes, listed below. No source field.
Flutter (axiom_flutter)stage and category are lower-camel-case Dart enums (ErrorStage.contractLoad), parsed without regard to case. code is a class such as ContractInvalid or HttpStatus(code); codes the binding does not name become UnknownCode(raw). No source field.

Compare stage and category without regard to case. Generated TypeScript or Dart types are authoritative for exact casing.

Codes added by the atmx-web JavaScript layer (0.147.5):

CodeWhenRetryable
WasmFetchFailedThe WebAssembly engine could not be downloadedYes
InitFailedThe engine failed to initializeNo
ContractLoadFailedOne or more contracts failed verification or loading during init; see InitResult.contractsNo
FatalErrorAn unexpected exception during initNo
JsonParseFailureThe engine returned an error the JavaScript layer could not parseNo

Stages

A failure's stage tells you where in the request it stopped:

Runtime stages along one request
Runtime stages along one request
Diagram source
flowchart LR
  L["Load contract: ContractLoad"] --> B["Build request: RequestBuild, ValidationRequest"]
  B --> R["Read cache: CacheRead"]
  R --> S["Send: NetworkSend"]
  S --> V["Receive: NetworkReceive"]
  V --> D["Validate and decode: ValidationResponse, Deserialize"]
  D --> W["Write cache: CacheWrite"]

Not every request passes every stage; a cache-only read stops early. Three stages sit outside the request path: Configuration (runtime or contract configuration), Runtime (engine lifecycle or internal execution), and FfiBoundary (the native or WebAssembly binding).

StageBoundary
ConfigurationRuntime or contract configuration
ContractLoadLoading or validating the contract artifact
RequestBuildEndpoint lookup, path, headers, or body construction
ValidationRequestThe outgoing value does not satisfy the contract
CacheReadReading a configured cache
NetworkSendConnecting or sending the request
NetworkReceiveReceiving transport or HTTP response data
ValidationResponseThe incoming value does not satisfy the contract
DeserializeJSON or codec decoding
CacheWriteSaving a response to the cache
RuntimeEngine lifecycle or internal execution
FfiBoundaryNative or WebAssembly binding boundary

Categories

The categories are Contract, Validation, Network, Timeout, Serialization, Cache, Auth, Server, Runtime, and Unknown. A category is broader than a code: several HTTP statuses can map to Auth or Server.

Codes

GroupCodes
ContractContractMissing, ContractInvalid, EndpointNotFound
RequestRequestCreationError, PayloadEncodingError
ValidationValidationError
NetworkNetworkConnectionFailed, NetworkTimeout, HttpStatus(status)
DataJsonParseError, CodecError
CacheCacheReadError, CacheWriteError
AuthenticationAuthTokenMissing, AuthTokenExpired
RuntimeNotInitialized, InternalError

Lower-level numeric FFI status values can merge several codes into one. Use the structured error your binding emits instead of copying a numeric table.

Handle errors

TypeScript excerpt
function messageFor(error: AxiomError): string {
  if (error.category.toLowerCase() === 'auth') return 'Please sign in again.';
  if (error.retryable) return 'Request failed. Try again.';
  if (error.code === 'ContractInvalid') {
    return 'This application release has an invalid data contract.';
  }
  return 'Something went wrong.';
}

Keep detailed diagnostic context in protected logs, not in a message the user sees.

Retry rules

  • Retry only when retryable is true or your application policy explicitly allows it.
  • Cap attempts and add jitter for network retries.
  • Do not retry an invalid contract, unknown endpoint, request validation error, or deterministic decoding failure without changing the input or the deployment.
  • Refresh or clear credentials before retrying an authentication failure.
  • Treat cache errors separately: a cache write failure is not a failed server operation.

Typed failures and execution aborts

A managed action declares named failure cases, each with a payload and an HTTP status. The endpoint chooses which payload fields each audience may see. The HTTP failure body carries only error.code and the selected error.payload.

  • Malformed envelopes and unknown cases are sanitized into transport errors.
  • Execution aborts (cancellation, deadline, budget, host fault, and an indeterminate outcome) stay separate from recoverable business cases.
  • New payload contracts need the version 2 contract reader.

The backend declaration catalog (axiom explain --schema) lists these failure categories: invalidInput, unauthenticated, forbidden, domain, invariant, policyExhausted, cancelled, deadline, internal, and indeterminate. See Managed logic and concurrency.

Database lifecycle codes (ADB)

The database commands (axiom database, axiom run on a database source) and the backend storage compiler print these codes.

CodeMeaningWhat to do
ADB1100Missing or invalid project identity, or a version that is not MAJOR.MINOR.PATCHDeclare one project(id: ..., version: "1.0.0") in the entry source; remove conflicting duplicate manifest metadata
ADB1101Invalid or tampered artifact, source snapshot, or ledgerRestore verified history; do not edit internal files
ADB1102The requested migration version or baseline is not availableKeep the complete catalog or an exported prefix
ADB1103The version is already used, or does not increaseAccept the suggested version, update the source, or opt in to --auto-version in CI
ADB1104A concurrent publisher, a changed parent, or an interrupted source editInspect, then retry against the accepted state
ADB1105Drift, overlapping ownership, or unreviewed existing scopeRun axiom database status; establish an exact baseline
ADB1106Unsupported engine capability, an unavailable or tampered validator runtime, or a replay mismatchInstall a matching validator or supported PostgreSQL; no candidate is accepted
ADB1107Invalid or unavailable connection, or the wrong engineSupply the URL, connection fields, or file for the declared engine
ADB1108Database execution or transport failureCheck the reported transaction outcome before retrying
ADB1109Missing or different signerRestore the enrolled signing provider
ADB1110A PostgreSQL password is requiredUse the masked prompt, PGPASSWORD, or --password in non-interactive runs
ADB1111A risk category needs approvalIn CI, pass the specific flag: --allow-destructive, --allow-data-dependent, or --allow-security-changes
ADB1112Existing rows have no value for a new required columnMake the column nullable, or declare a default or backfill
ADB1113Rollback crosses a data overwrite whose old values were not archivedDefine a compensating migration or restore a backup
ADB1120Invalid typed backend storage mappingCheck the exact fields, values, and resource signatures
ADB1121Invalid or unsupported typed data evolutionUse the supported atomic subset or its qualified adapter

See Database contracts and axiom database.

Other diagnostic code families

PrefixProduced byReference
AXSEC-The security analyzer (axiom security check, axiom build)Security rules
AUIThe Acore UI compiler and development hostAcore UI
AXIOM_APP_.axiomapp verification, such as AXIOM_APP_FORMAT and AXIOM_APP_CHECKSUMApp lifecycle and targets
ADBDatabase contract commandsThis page