Open app

Errors

Every error the API and the Ayo program raise, with what causes it.

The error envelope

Every failed API request answers with one JSON object under error. Branch on code; show message.

FieldTypeWhat it is
codestringA stable error code; branch on it
messagestringA sentence that can be shown to a person
retryablebooleanWhether the same request can succeed later
stagestringThe step of the flow that failed
fieldErrorsobject, optionalFor VALIDATION_ERROR: each invalid field with its problems
programErrorobject, optionalFor a refused transaction: the program address, error name and number
retryAfterSecondsinteger, optionalFor RATE_LIMITED: seconds to wait
requestIdstring, optionalAn ID for this request, for logs

API error codes

CodeHTTPRaised when
VALIDATION_ERROR400A field is missing or malformed. fieldErrors names each one.
UNAUTHORIZED401The request needs credentials it didn't carry.
ORIGIN_NOT_ALLOWED403The browser origin isn't on the API's allow list.
NOT_FOUND404No agent, service, tab, receipt or build with that ID.
PROGRAM_UNAVAILABLE409Ayo's program isn't deployed on the cluster the API reads.
CONFIGURATION_REQUIRED409The program's Config account hasn't been initialized.
IDEMPOTENCY_CONFLICT409The idempotency key was already used with a different body.
TRANSACTION_EXPIRED409The blockhash expired before the transaction landed. Build it again.
PAYLOAD_TOO_LARGE413The body is larger than the API accepts.
UNSUPPORTED_MEDIA_TYPE415The body isn't JSON.
SIMULATION_FAILED422The transaction failed simulation. programError names the program and its error.
CHAIN_REFUSED422The cluster rejected the transaction.
RATE_LIMITED429Too many requests. Wait retryAfterSeconds.
INTERNAL_ERROR500The API failed. Retrying may help.
UPSTREAM_UNAVAILABLE502The RPC or the Ring indexer behind the API didn't answer.
WALLET_REJECTED409The wallet declined to sign.
WALLET_CHANGED422The wallet changed the transaction in a way the API can't accept.
RPC_UNAVAILABLE503The RPC node didn't answer. Retry.
AGENT_PAUSED409The agent is paused. Its owner can resume it.
TAB_NOT_OPEN409The tab isn't open, so it can't take this action.
NOT_OWNER403The signer doesn't own this agent or service.
WINDOW_NOT_ELAPSED409The settlement window hasn't passed, so the tab can't be flagged yet.
INVALID_VOUCHER422The voucher doesn't verify for this tab and agent.

Stages

stage names the step of the flow that failed.

StageFailed while
validationThe request was checked
authCredentials were checked
readData was read
uploadA file was uploaded
buildThe transaction was built
walletThe wallet signed
co_signThe API co-signed
simulationThe transaction was simulated
sendThe transaction was sent
confirmationThe transaction was followed to confirmation

Program errors

Raised by Ayo's program and returned in programError (API) or in the transaction logs as a custom error number. Anchor numbers program errors from 6000.

NumberNameRaised when
6000NotOwnerThe signer does not control this account.
6001AgentPausedThe agent is paused.
6002TabNotOpenThis action requires an open tab.
6003TabNotSettlingThis action requires a tab awaiting confirmation.
6004TabFinalThis tab has already reached a final state.
6005WindowNotElapsedThe settlement window has not elapsed.
6006InvalidVoucherThe voucher does not match a verified Ed25519 instruction.
6007InvalidTermsThe public registration or billing terms are invalid.
6008OutstandingTabsThe service has outstanding tabs under its current terms.

SDK

The service middleware answers refused calls with an HTTP status and a one-line message, listed under Responses. What the SDK throws to your own code is listed under What fetch throws, What settle throws and What serve throws.