> ## Documentation Index
> Fetch the complete documentation index at: https://docs.peaq.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> Error class hierarchy, activation and deployment error families, event revert codes, and 20 faucet codes for the peaqOS SDK.

Every error raised by the SDK (peaq's code library (Python and JS) you install to call all this functionality without writing low-level blockchain calls yourself.) extends a common base, with one exception: a non-integer event `value` (and, for a Solana event in JS, `timestamp` or `sourceChainId`) raises the language's own `TypeError`, not a `PeaqosError`. Faucet-specific codes are surfaced on the error instance (`error.code`) so callers can branch without string matching.

## Class hierarchy

> [tab] JavaScript
>
> ```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
> PeaqosError
> ├── ValidationError
> ├── RuntimeError
> ├── ValueCapExceeded
> └── RateLimitExceeded
> ```
>
> These four extend `PeaqosError` directly. Each function area adds its own family alongside them, also extending `PeaqosError`: `MonetizationError` (with `MonetizationCompatibilityError`), `ProvisioningError`, `StreamError`, `OrchestrationError`, and the activation and deployment family `DeploymentConfigError`, `ActivationError` (with its subclass `PendingTransactionError`), `UnsupportedError` (see [Activation and deployment errors](#activation-and-deployment-errors)). `McrApiError`, a `RuntimeError` subclass, covers MCR query HTTP, transport and non-JSON failures; response shape and correlation failures are `RuntimeError` with code `BAD_RESPONSE` (see [MCR API error codes](#mcr-api-error-codes)). So `err instanceof PeaqosError` covers every SDK error; catching `RuntimeError` alone will miss `ValueCapExceeded` and `RateLimitExceeded`.
>
> ```typescript theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
> import {
>   PeaqosError,         // base
>   ValidationError,     // bad input
>   RuntimeError,        // chain or HTTP failure; carries optional `code`
>   ValueCapExceeded,    // operational cap hit (extends PeaqosError)
>   RateLimitExceeded,   // operational cap hit (extends PeaqosError)
> } from "@peaqos/peaq-os-sdk";
> ```

> [tab] Python
>
> ```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
> PeaqosError
> ├── ValidationError
> ├── RpcError
> ├── ApiError
> ├── ValueCapExceeded
> └── RateLimitExceeded
> ```
>
> ```python theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
> from peaq_os_sdk import (
>     PeaqosError,
>     ValidationError,
>     RpcError,         # event submission (EventRegistry writes)
>     ApiError,         # HTTP API errors (faucet, MCR API)
>     ValueCapExceeded,
>     RateLimitExceeded,
> )
> ```
>
> Python raises `RpcError` from event submission and `ApiError` from the faucet and the MCR API; activation, renewal, management and every other chain read raise `ActivationError` (for example `READ_FAILED`, `RPC_RATE_LIMITED`) or `DeploymentConfigError`. JavaScript reports the event submission and faucet failures as `RuntimeError` with a `code` field. The root also exports `DeploymentConfigError`, `ActivationError`, `PendingTransactionError` (a subclass of the activation error), `UnsupportedError`, and `InputSizeError` (a `ValidationError` subclass); `peaq_os_sdk.monetization` adds `MonetizationCompatibilityError`, `MonetizationNetworkError`, `MonetizationResponseError`, `MonetizationTimeoutError`, and `MonetizationCancelledError`. All extend `PeaqosError`. `ApiError` carries `http_status`, `server_code`, `server_message`, `operation`, `home_protocol_chain_id`, and `retryable`.

***

## Activation and deployment errors

Raised by activation, machine management, event submission and the monetization client. Codes are string literals on `err.code` in both SDKs; the contract a revert came from travels on `err.contract`, and reverts are decoded by 4-byte selector scoped to that contract's ABI. An unrecognised selector still surfaces as `CONTRACT_REVERTED` with the raw `revertData` / `revert_data`.

| Class | Codes | Notes |
| :- | :- | :- |
| `DeploymentConfigError` | `DEPLOYMENT_UNKNOWN`, `DEPLOYMENT_UNAVAILABLE` (names the missing contract on `missingContracts` / `missing_contracts`: in Python only for the EventRegistry; in JS also for a Solana program the record does not name, such as `machineSubscriptionTerminal`), `DEPLOYMENT_NOT_CONFIGURED`, `ADDRESS_OVERRIDE_MISMATCH` | Deployment selection and address overrides. The activation, machine and event commands of the CLI report these codes under the same names, except `DEPLOYMENT_UNAVAILABLE` as `ADDRESSES_UNSET`; `LINK_PUSH_UNSUPPORTED` also keeps its name, and any unmapped code is `DEPLOYMENT_CONFIG_ERROR`; `qualify mcr`, `show` and `monetize` report any of them as `CONFIG_ERROR` (exit `3`). Event submission on a record without an EventRegistry (`agung-2026-08-28`) raises `DEPLOYMENT_UNAVAILABLE` with `missingContracts: ["eventRegistry"]` (JS) / `missing_contracts=("event_registry",)` (Python) before any RPC or signature. Agung monetization and MCR queries raise `DEPLOYMENT_UNAVAILABLE`, and so does a Solana call on a record without a Solana half (in JS also on a client with no Solana configuration); Python raises `DEPLOYMENT_NOT_CONFIGURED` for a Solana call with no Solana RPC endpoint. All before any read. |
| `ActivationError` | Preflight: `CHAIN_MISMATCH`, `CONTRACT_NOT_DEPLOYED`, `PEER_MISMATCH`, `SIGNER_UNAVAILABLE`, `NOT_ECONOMIC_AUTHORITY` (the selected deployment's `MachineSubscription` is not the economic authority), `TECHNICALLY_PAUSED` (activation and renewal read `MachineStateAndSync.isTechnicalPausedGlobal()` and `isTechnicalPaused(machineId)` before any approval; on Solana the quote reads the suite's `TechnicalPause` account, the request, mint and link push read it before signing, and a settlement under a pause fails its pre-signing simulation; cancelling a request is not blocked by it; the on-chain `TechnicallyPaused()` revert and the Solana program error decode to the same code), `INVALID_TIER`, `PRICE_NOT_AVAILABLE`. Quote and funds: `MACHINE_ID_MISMATCH`, `MAX_NET_PEAQ_EXCEEDED`, `MAX_USDT_EXCEEDED`, `INSUFFICIENT_BALANCE`, `APPROVAL_FAILED`, `ALLOWANCE_INSUFFICIENT`, `SLIPPAGE_EXCEEDED`. Reads: `MACHINE_NOT_FOUND`, `READ_FAILED`. Management: `NOT_OWNER_OR_CONTROLLER`, `NOT_MACHINE_OWNER`, `AUTHENTICATION_REWRITE_REQUIRED`, `MACHINE_RELOCATING`, `ERC721_INCORRECT_OWNER`, `ERC721_INSUFFICIENT_APPROVAL`, `ERC721_INVALID_APPROVER`, `ERC721_INVALID_OPERATOR`. Submission: `CONTRACT_REVERTED`, `EVENT_MISMATCH`, `STATE_MISMATCH`, `ABORTED`, and a pending result when the outcome is not known: JS `RECEIPT_UNAVAILABLE` (activation, renewal, suspend and resume, Solana events) or `TRANSACTION_PENDING` (peaq management writes, as `ActivationError` with `.submittedTransaction`; the Solana onboarding writes and `registerSolanaOperator`, as `PendingTransactionError` with `.submitted`; Solana events); Python `PENDING_TRANSACTION`, as `PendingTransactionError` with `.submitted`, except Solana event submission, which raises a plain `ActivationError` with that code. Branch on `code`, not on the subclass. `TIER_CHANGE_WHILE_ACTIVE` (a renewal `tier` differs from the stored tier while the machine is Active; only on a deployment record that enables tier selection, so `peaq-mainnet` and `agung-2026-08-28` raise `RENEWAL_TIER_UNSUPPORTED` instead), `RENEWAL_TIER_UNSUPPORTED` (a `tier` was passed but the deployment record does not enable tier selection; raised before any RPC), `PEER_UNSET` (InfoDesk has no address for a role the call needs), `RPC_RATE_LIMITED` (the peaq RPC kept rate-limiting reads after the retry budget; sends are never retried) | Attributes `code`, `contract`, `operation`, `solidityError` / `solidity_error`, `revertData` / `revert_data`, `transactionHash` / `transaction_hash`. Never resubmit after a pending or receipt-unavailable result; reconcile the hash. `PEER_MISMATCH` on `machineBridgeAdapter`, and a `READ_FAILED` that names `fullMode()`, both mean the installed SDK predates the current contracts; upgrade to the latest SDK. |
| `UnsupportedError` | `SVM_APPROVAL_UNSUPPORTED`, `SVM_SAFE_TRANSFER_UNSUPPORTED` (JS, `approveMachine` / `safeTransferMachine` once the machine resolves to Solana), `SVM_APPROVAL_FOR_ALL_UNSUPPORTED` (JS, `setMachineApprovalForAll` with `chain: "solana"`), `SOLANA_OPERATION_UNSUPPORTED` (Python, `approve_machine` / `safe_transfer_machine`; Python's `set_machine_approval_for_all` stays an EVM write) | A call with no equivalent on the machine's chain (a Solana-homed machine). Raised after the home-chain read and before signing; JS `SVM_APPROVAL_FOR_ALL_UNSUPPORTED` is raised before any RPC. In JS only a client with Solana configured detects a Solana home. Carries `operation` and `replacement`. |
| Solana-homed machines | `ActivationError`: `MACHINE_HOMED_ELSEWHERE` (Python reads: the machine exists on another chain, named in the error), `HOME_CHAIN_UNRESOLVED` (JS reads, with `homeChainState` and `homeChainReason`; JS event submission, without them), `CHAIN_MISMATCH` (machine not homed on the configured Solana deployment), `TRANSACTION_PENDING` (JS; Python: `PENDING_TRANSACTION`), `EVENT_MISMATCH`, `STATE_MISMATCH` (also a native signer or timestamp problem before broadcast), the terminal-first onboarding codes (registration `CHAIN_NOT_REGISTERED`, `OPERATOR_BOUND_ELSEWHERE`; quote and request `TERMINAL_PAUSED`, `OPERATOR_NOT_REGISTERED`, `HOME_CHAIN_MISMATCH`, `REQUEST_ALREADY_OPEN`, `MACHINE_ALREADY_ACTIVE`, `ROUTE_NOT_WHITELISTED`, `PRICE_TOO_OLD`, `PRICE_TIMESTAMP_IN_FUTURE`, `TIER_NOT_PRICED`, `BOND_UNSIZEABLE`, `BOND_TOO_LARGE`, `ZERO_ESCROW_AMOUNT`, `ESCROW_BELOW_BOND`, `ESCROW_BALANCE_MISMATCH`, `INSUFFICIENT_BALANCE`, `NONCE_IN_USE`, `NONCE_NOT_MONOTONIC`, `NONCE_JUMP_TOO_LARGE`, `MACHINE_ID_TAKEN_ON_PEAQ`; finalise and cancel `REQUEST_NOT_COMMITTED`, `COMMIT_EXPIRED`, `NOT_ACTIVATION_PAYER`, `FINALISE_PATH_MISMATCH`, `FINALISE_TABLE_MISSING`, `FINALISE_TABLE_STALE`, `SWAP_ROUTE_MISCONFIGURED`, `TICK_ACCOUNTS_INVALID`, `UNSUPPORTED_TOKEN_PROGRAM`, `REQUEST_NOT_CANCELLABLE`, `REQUEST_NOT_YET_EXPIRED`, `REQUEST_CLOSED` (the request was cancelled or refunded and its nonce is spent, so a phase run alone on it (the credit or bond wait, the settlement or its preview, the cancel) has nothing to do; run the request phase again and a new request opens at the next nonce); mint `ACTIVATION_NOT_BONDED`, `ACTIVATION_REQUEST_MISMATCH`, `EVM_OPERATOR_MISMATCH`) and the terminal results' `exit` values `REQUEST_EXPIRED` and `ACTIVATION_REFUNDED`, the link push codes `MACHINE_NOT_ONBOARDED`, `EVM_OPERATOR_UNSET`, `LINK_PUSH_TOO_LARGE`, `TV_OUTBOX_MISSING` (the adapter has no Trust Validator outbox for peaq), `TV_INBOUND_REFUSED` (peaq refuses the node's deliveries), and on a LayerZero route `LINK_CONFIG_UNAVAILABLE`, `BRIDGING_DISABLED`, `LZ_SEND_LIBRARY_UNSUPPORTED` and a `ValidationError` on `max_link_push_fee_lamports` / `maxLinkPushFeeLamports` when the cap is missing; a fee or rent over its ceiling is `FEE_LIMIT_EXCEEDED` / `RENT_LIMIT_EXCEEDED` in Python and `SVM_FEE_EXCEEDED` in JS, and a payer that cannot pay a write and keep its own rent-exempt minimum is `INSUFFICIENT_NATIVE_BALANCE` in Python (CLI: `INSUFFICIENT_SOL`) and `INSUFFICIENT_BALANCE` in JS, all raised before signing; a Solana read that a lagging server keeps refusing (`-32016`) is `READ_FAILED` naming the code (CLI: `RPC_FAILED`); and `LINK_PUSH_UNSUPPORTED` (`DeploymentConfigError`, the deployment record names no LayerZero endpoint); a link push quote whose code is `LINK_ALREADY_PUSHED` is a result, not an error, and sends nothing, `SUBSCRIPTION_NOT_ELIGIBLE` (on the `terminal` reader, which the Solana half of `peaq-mainnet` (JS: `solana-mainnet`) uses: the mint needs a `SubscriptionTerminal` that peaq has sequenced (`last_seq` not 0) in status Active, Grace or Runoff, and an event needs status Active or Grace; the CLI maps it to exit 1), and in JS the native budget codes `SVM_FEE_EXCEEDED`, `SVM_COMPUTE_EXCEEDED`, `SVM_TRANSACTION_TOO_LARGE`. `DeploymentConfigError`: `SVM_PACKAGE_MISSING` (JS only: `@solana/web3.js` or `@coral-xyz/anchor` not installed), `DEPLOYMENT_UNAVAILABLE` (a deployment without a Solana half; in JS also no Solana RPC configured), `DEPLOYMENT_NOT_CONFIGURED` (Python: no Solana RPC endpoint), and in JS the deployment-record checks `SVM_PACKAGE_UNUSABLE`, `SVM_CLUSTER_MISMATCH`, `SVM_PROGRAM_NOT_DEPLOYED`, `SVM_ACCOUNT_OWNER_MISMATCH`, `SVM_PEER_MISMATCH` before the first account read. `ValidationError` subclass `InputSizeError` (Python) for oversized DID or credential input. MCR queries: `McrApiError` (JS) / `ApiError` (Python) with `INVALID_REQUEST`, `UNAUTHORIZED`, `NOT_FOUND`, `MACHINE_HOMED_ELSEWHERE`, `CONFLICT`, `SERVICE_UNAVAILABLE` and the server's own code on `serverCode` / `server_code`. Monetization refusals before anything is sent (`ValidationError` with `code` in Python, `MonetizationValidationError` with `code` in JS): `UNSUPPORTED_HOME_CHAIN`, `SIGNER_INCOMPATIBLE_WITH_HOME`, `SOLANA_MONETIZATION_UNVERIFIED`, `SIGNER_NOT_NATIVE_OWNER`, `AUTHORIZATION_CONTEXT_CHANGED`, `INVALID_SIGNER_OUTPUT` | Solana management writes report rather than raise once a transaction landed. Python: `status` is `confirmed`, `conflicting`, `failed` or `pending`, plus `expired` from reconciliation, the only status with `may_resubmit=True`. JS: `confirmed`, `unconfirmed`, `blocked` or `failed`; `unconfirmed` may have landed and is reconciled, never replaced. `NOT_FULL_MODE` is still exported but no longer raised by the activation preflight, which reads `isEconomicAuthority()`. See [SDK JS: Solana](https://docs.peaq.xyz/peaqos/sdk-reference/sdk-js.md#solana-svm), [SDK Python: Solana](https://docs.peaq.xyz/peaqos/sdk-reference/sdk-python.md#solana). |
| Lifecycle and pool codes (both SDKs) | `ActivationError`: `ALREADY_ACTIVATED`, `NOT_ACTIVATED`, `ALREADY_TERMINATED`, `NOT_ACTIVE`, `NOT_SUSPENDED`, `PROVISION_POOL_NOT_CONFIGURED`, `INSUFFICIENT_RESERVE`, `INSUFFICIENT_USDT_RECEIVED` | Decoded reverts from `MachineStateAndSync`, `MachineSubscription` and the provision pool. Not retryable: fix the state or the configuration. Python also raises `ActivationError` `DRY_RUN_UNSUPPORTED`, which is not a revert: `preview_event_submission` (the CLI's `qualify event --dry-run`) refuses a machine that does not resolve to Solana before any send |
| Event revert codes (both SDKs) | `NOT_OWNER_OR_CONTROLLER`, `SUBSCRIPTION_NOT_ELIGIBLE`, `METADATA_TOO_LARGE`, `INVALID_CURRENCY_SHAPE`, `FUTURE_TIMESTAMP`, `MACHINE_NOT_FOUND` (`ERC721NonexistentToken`) | Raised when the EventRegistry refuses an event: JS `RuntimeError` with that `code`, Python `RpcError` with that `code`. `InvalidEventType` and `InvalidTrustLevel` (and in Python `InvalidAddress`) keep their Solidity names as the code; any other revert is `TX_REVERTED` in Python and, in JS, the decoded Solidity name, or a `RuntimeError` with no `code` when the ABI cannot decode it. On `peaq-mainnet` an event for a machine neither chain holds is refused before signing. Python: `RpcError` `MACHINE_NOT_FOUND` when a Solana endpoint is configured and the cluster holds nothing, otherwise `ActivationError` `MACHINE_HOMED_ELSEWHERE`. JS: a client without `svm` gets `RuntimeError` `MACHINE_NOT_FOUND` from the pre-flight revert; an `svm` client with `getSigner` gets `ActivationError` `HOME_CHAIN_UNRESOLVED`, and one without it `DeploymentConfigError` `DEPLOYMENT_NOT_CONFIGURED`. |
| `MonetizationCompatibilityError` | `MONETIZATION_API_INCOMPATIBLE` | The MCR's `/.well-known/peaq-monetization` signal is missing or does not match the deployment. `mcr.peaq.xyz` publishes the signal; the error means its protocol version, chain ID, or `MachineRegistry` address does not match the selected deployment. |
| `MonetizationApiError` (JS) / `MonetizationError` (Python) | Server codes from the [PUT endpoint page](https://docs.peaq.xyz/peaqos/api-reference/put-machine-monetization.md#error-responses), including `MACHINE_UNAVAILABLE` (503, the only retryable code) and `CHAIN_UNAVAILABLE` | Branch on `code`, never on the message. Timeouts and cancellations are separate classes: Python `MonetizationTimeoutError` (`MONETIZATION_TIMEOUT`) and `MonetizationCancelledError` (`MONETIZATION_CANCELLED`); JS `MonetizationTimeoutError` and `MonetizationCancellationError`, which carry no `code`. |

Error messages pass through credential redaction (URL userinfo, secret query parameters, 32-byte hex). Revert data and transaction hashes are kept unredacted on the attributes.

***

## Faucet error codes

All 20 codes the Gas Station (A peaq service that hands a brand-new, empty wallet a tiny starting amount of tokens so it can afford its first network fees. Gated by 2FA.) can return. `POST /faucet/fund`, `POST /2fa/setup`, and `POST /2fa/confirm` each return a subset. For example, `QR_GENERATION_FAILED` only comes from `/2fa/setup`. `QR_NOT_FOUND` and `QR_EXPIRED` come from `GET /2fa/qr/{token}` when you open the `qrImageUrl`, so they reach your HTTP client, not an SDK error. Codes surface as `RuntimeError.code` (JS) or `ApiError.code` (Python).

> [accordion] 2FA errors
>
> | Code | Description | Retry |
> | :- | :- | :- |
> | `INVALID_2FA` | OTP rejected by the faucet | Yes: submit a fresh 6-digit code |
> | `2FA_NOT_CONFIGURED` | Owner has not completed `setup_faucet_2fa` | No: re-run setup |
> | `2FA_NOT_ACTIVE` | 2FA enrolled but not confirmed | No: call `confirm_faucet_2fa` with a valid OTP |
> | `2FA_LOCKED` | Too many invalid attempts; owner temporarily blocked | After lockout window |

> [accordion] Idempotency errors
>
> | Code | Description | Retry |
> | :- | :- | :- |
> | `DUPLICATE_REQUEST` | Same `request_id` already in flight | No: use a different `request_id` or wait for prior result |
> | `REQUEST_ALREADY_PROCESSED` | Same `request_id` already resolved | No: read the prior result |

> [accordion] Rate limit & cap errors
>
> | Code | Description | Retry |
> | :- | :- | :- |
> | `RATE_LIMITED` | Faucet rate limit exceeded | After cooldown |
> | `CAP_EXCEEDED_OWNER` | Daily per-owner funding cap reached | Next day |
> | `CAP_EXCEEDED_WALLET` | Daily per-target-wallet cap reached | Next day, or target a different wallet |

> [accordion] Validation errors
>
> | Code | Description | Retry |
> | :- | :- | :- |
> | `INVALID_PAYLOAD` | Request body malformed | No: fix the payload |
> | `INVALID_OWNER_ADDRESS` | `owner_address` not a recognized format | No |
> | `INVALID_TARGET_ADDRESS` | `target_wallet_address` not recognized | No |
> | `INVALID_CHAIN_ID` | `chain_id` not configured on the faucet | No |
> | `INVALID_REQUEST_ID` | `request_id` not a UUID | No |

> [accordion] Chain & server errors
>
> | Code | Description | Retry |
> | :- | :- | :- |
> | `TRANSFER_FAILED` | On-chain transfer reverted or stalled | Yes |
> | `CHAIN_RPC_ERROR` | Faucet's RPC call failed | Yes |
> | `INTERNAL_ERROR` | Faucet internal failure | Yes |

> [accordion] QR errors
>
> | Code | Description | Retry |
> | :- | :- | :- |
> | `QR_NOT_FOUND` | QR image expired or never created | No: re-run setup |
> | `QR_EXPIRED` | QR retrieval attempted after \~2 min TTL | No: re-run setup |
> | `QR_GENERATION_FAILED` | Faucet could not generate the image | Yes |

Full flow reference: [Gas Station concept](https://docs.peaq.xyz/peaqos/concepts/gas-station.md), [setupFaucet2FA](https://docs.peaq.xyz/peaqos/sdk-reference/sdk-js.md#setupfaucet2fa), [fund\_from\_gas\_station](https://docs.peaq.xyz/peaqos/sdk-reference/sdk-python.md#fund_from_gas_station).

***

## MCR API error codes

Returned by `queryMcr` / `query_mcr`, `queryMachine` / `query_machine`, and `queryOperatorMachines` / `query_operator_machines` against the deployment's MCR server (`mcr.peaq.xyz` on `peaq-mainnet`). On a deployment with no MCR (`agung-2026-08-28`) they raise `DeploymentConfigError` `DEPLOYMENT_UNAVAILABLE` before any request; that is not an `McrApiError` / `ApiError`. In JS, HTTP, transport and non-JSON failures throw `McrApiError` (a `RuntimeError` subclass) with these codes, and response shape and correlation failures (a malformed or non-canonical `machine_id`, a response about a different machine or operator than requested, a `null` or non-integer `mcr_score`) throw `RuntimeError` with code `BAD_RESPONSE`. In Python every one of these failures is `ApiError` with the same codes. Both SDKs carry the server's own code on `serverCode` / `server_code` plus `httpStatus` / `http_status`, `homeProtocolChainId` / `home_protocol_chain_id` and `retryable` (a classification only; the transport never retries). The constants are `MCR_HTTP_ERROR_CODE` in both SDKs.

| Code | Cause | Retry |
| :- | :- | :- |
| `INVALID_REQUEST` | HTTP 400, for example an address-form DID sent to `mcr.peaq.xyz` | No: check the input |
| `UNAUTHORIZED` | HTTP 401 or 403 | No |
| `NOT_FOUND` | The DID, machine, or token ID was not found by the MCR API (an untyped HTTP 404). A machine activated moments ago can answer this until the MCR indexes it | No for a wrong input; yes, with backoff, right after activation |
| `MACHINE_HOMED_ELSEWHERE` | HTTP 409 with that server code: the machine exists but the server could not read its home chain; `home_protocol_chain_id` names it. Per the server's contract | No: not absence, do not retry as `NOT_FOUND` |
| `CONFLICT` | Any other HTTP 409 | No |
| `BAD_RESPONSE` | The MCR returned a non-JSON body or an unexpected payload shape | No: file an issue if it persists |
| `HTTP_ERROR` | The MCR returned a non-2xx status other than 400, 401, 403, 404, 409, 503 and 5xx | Maybe: surface the status code and decide |
| `SERVER_ERROR` | The MCR returned a 5xx other than 503. `retryable: false` in both SDKs | Maybe: the reads are GETs, so one retry with backoff is safe |
| `SERVICE_UNAVAILABLE` | The MCR returned 503 (`Service not initialised` / `Chain unavailable`; per the server's contract also a Solana-homed machine that is relocating or whose home chain is unreachable). `retryable: true` (in both SDKs `TIMEOUT` and `NETWORK_ERROR` are retryable too) | Yes, with backoff |
| `TIMEOUT` | The HTTP request exceeded `timeoutMs` | Yes |
| `NETWORK_ERROR` | Transport-level failure (DNS, TCP, TLS) | Yes |
| `ABORTED` | The caller aborted the request via `AbortSignal` (JS only) | Caller's choice |

## Verify errors

Raised by the experimental Verify surface (`@peaqos/peaq-os-sdk/verify`, `peaq_os_sdk.verify`). All extend `VerifyError`, a `PeaqosError`; the typed fields carry the outcome and the messages hold no server text, URLs or identifiers. Full tables in [SDK JS: Verify](https://docs.peaq.xyz/peaqos/sdk-reference/sdk-js.md#verify) and [SDK Python: Verify](https://docs.peaq.xyz/peaqos/sdk-reference/sdk-python.md#verify).

| Class | Raised by | Cause |
| :- | :- | :- |
| `VerifyConfigError` | read client | Invalid API origin or options, or the client is closed. Before any request |
| `VerifyValidationError` | read client | `machineId` is not a decimal in `1..2^256-1`, or bad request options. Before any request |
| `VerifyIdentityError` | read client | `404 MACHINE_NOT_FOUND`: `reason: "machine-not-found"` in JS, subclass `VerifyMachineNotFoundError` in Python. The only error that means there is no machine with this ID in the Verify service |
| `VerifyRateLimitError` | read client | `429`; `retryAfterSeconds` / `retry_after_seconds` is 1..60 or unset. Never retried by the SDK |
| `VerifyTransportError` | read client | Timeout, cancellation, network failure, `500`/`503` (`causeCategory` / `cause_category` `"unavailable"`) or another documented HTTP error (`"http-status"`) |
| `VerifyProtocolError` | read client | Malformed, oversized or undocumented response, including `401`/`403`. Not a verification state |
| `VerifyCryptographicError` | chip preflight | Certificate is not a valid CA306 leaf, does not chain to the trust bundle or is not the supported profile; chip or controller signature does not match this attempt |
| `VerifyEvidenceError` | chip preflight | Evidence document breaks its schema, exceeds its size limit, could not be canonicalized, or a derived value was zero |
| `VerifyFreshnessError` | chip preflight | Challenge outside its five-minute window |

## OWS signing error codes

Raised when transaction (A single signed request that changes the ledger. Its hash is a unique, receipt-like ID you can use to look it up later.) signing (Using your private key to produce a cryptographic stamp proving you approved a specific action, without ever revealing the key.) routes through an OWS vault wallet (An open standard for storing wallet keys in an encrypted local file (a vault) with a backup phrase, instead of a bare key in a text file.) (`PeaqosClient.fromWallet` / `from_wallet` with `owsSigning: true` / `ows_signing=True`). The SDK normalises the upstream OWS error code into a typed SDK exception. Only `INVALID_INPUT` becomes `ValidationError(field="transaction")`; the other four become a plain `PeaqosError` in both SDKs. Python sets the OWS code on `err.code` and chains the raw error as `__cause__`; JS keeps the raw error on `err.cause` and sets no code.

| Code | Cause | Surfaces as |
| :- | :- | :- |
| `WALLET_NOT_FOUND` | Vault wallet name / UUID does not exist | `PeaqosError` (`err.code` in Python) |
| `INVALID_PASSPHRASE` | Wrong vault passphrase | `PeaqosError` (`err.code` in Python) |
| `INVALID_INPUT` | Malformed transaction or sign-hash payload | `ValidationError(field="transaction")` |
| `POLICY_DENIED` | Signing blocked by an OWS policy rule | `PeaqosError` (`err.code` in Python) |
| `CHAIN_NOT_SUPPORTED` | Transaction `chainId` is not configured in OWS | `PeaqosError` (`err.code` in Python) |

Constants exported from the JS SDK root and from `peaq_os_sdk.constants` in Python as `OWS_ERROR_WALLET_NOT_FOUND`, `OWS_ERROR_INVALID_PASSPHRASE`, `OWS_ERROR_INVALID_INPUT`, `OWS_ERROR_POLICY_DENIED`, `OWS_ERROR_CHAIN_NOT_SUPPORTED`. JS additionally exports the `OwsSigningErrorCode` union type. Python's `evm_message_signer_from_wallet` (EIP-191 message signing, used for monetization) raises `PeaqosError` with `OWS_UNAVAILABLE`, `OWS_WALLET_UNAVAILABLE` or `OWS_MESSAGE_SIGNING_FAILED`.

In the JS SDK an OWS signing failure surfaces as a `PeaqosError` with no `code`, and `err.cause.code` is the native binding's `"GenericFailure"`, so the OWS codes cannot be branched on in JS yet; log `err.message` instead. In Python, branch on `err.code`:

```python theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
from peaq_os_sdk import PeaqosError
from peaq_os_sdk.constants import (
    OWS_ERROR_INVALID_PASSPHRASE,
    OWS_ERROR_CHAIN_NOT_SUPPORTED,
)

try:
    client.activate_machine(...)  # any signed write
except PeaqosError as err:
    if err.code == OWS_ERROR_INVALID_PASSPHRASE:
        ...  # prompt re-auth
    if err.code == OWS_ERROR_CHAIN_NOT_SUPPORTED:
        ...  # OWS chain config bug
    raise
```

## SDK transaction sentinels

Raised by the SDK's transaction helper around event submission. Surfaced as `RuntimeError.code` (JS) or `RpcError.code` (Python).

| Code | Cause |
| :- | :- |
| `WALLET_NOT_CONFIGURED` | Method requires a signer but none was configured. (JS only, and not raised through the public client: `PeaqosClient` always binds a signing account, from `privateKey`, `fromEnv()` or `fromWallet()`. In Python, a client built without an OWS signer needs `private_key` unless it is built with `deployment=DeploymentConfig(creation_home="solana", solana_rpc_url=...)`; otherwise construction raises `ValidationError`. A write without a signer raises `ActivationError` `SIGNER_UNAVAILABLE`.) |
| `TX_REVERTED` | The transaction was mined and its receipt is reverted (no decoded reason). In Python also any pre-flight revert the SDK does not map. A JS pre-flight revert carries the event revert code or the decoded Solidity error name instead; one the ABI cannot decode (or any non-revert failure) is a `RuntimeError` with no `code`. |
| `RECEIPT_AWAIT_FAILED` | Transaction was submitted but the SDK could not retrieve a receipt. The tx may still have landed. The error carries no transaction hash field (in JS the hash is in the message text), so check the sender's recent transactions or nonce before retrying. |

## Faucet / HTTP envelope sentinels

Raised by the Python SDK when a faucet response is reachable but unparseable, as `ApiError.code` (MCR responses use `BAD_RESPONSE`). In JS the same cases are `RuntimeError` with code `INTERNAL_ERROR`, the code the faucet also uses for its own internal failure, and a JS faucet transport failure carries no `code`.

| Code | Cause |
| :- | :- |
| `INVALID_RESPONSE` | Faucet returned a non-JSON body. |
| `UNEXPECTED_RESPONSE` | Faucet returned JSON but the `status` / `code` / `data` envelope did not match the expected shape for the endpoint. |
| `NETWORK_ERROR` | Transport-level failure during a faucet call (DNS, connection refused, TLS, timeout via `requests.RequestException`). Same sentinel as the MCR API table above. |

## Error handling patterns

> [tab] JavaScript
>
> ```typescript theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
> import {
>   PeaqosError,
>   ValidationError,
>   RuntimeError,
> } from "@peaqos/peaq-os-sdk";
>
> try {
>   await client.fundFromGasStation(params, faucetUrl);
> } catch (err) {
>   if (err instanceof ValidationError) {
>     // fix caller input
>   } else if (err instanceof RuntimeError) {
>     switch (err.code) {
>       case "INVALID_2FA":
>         // prompt for a fresh TOTP
>         break;
>       case "RATE_LIMITED":
>         // back off and retry after the cooldown
>         break;
>       case "CAP_EXCEEDED_OWNER":
>       case "CAP_EXCEEDED_WALLET":
>         // surface cap messaging
>         break;
>       default:
>         throw err;
>     }
>   } else {
>     throw err;
>   }
> }
> ```

> [tab] Python
>
> ```python theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
> from peaq_os_sdk import ValidationError, ApiError
>
> try:
>     client.fund_from_gas_station(
>         owner_address=owner,
>         target_wallet_address=target,
>         chain_id="peaq",
>         two_factor_code=totp,
>         faucet_base_url=faucet_url,
>     )
> except ValidationError:
>     # fix caller input
>     raise
> except ApiError as err:
>     if err.code == "INVALID_2FA":
>         # prompt for a fresh TOTP
>         pass
>     elif err.code == "RATE_LIMITED":
>         # back off and retry after the cooldown
>         pass
>     elif err.code in ("CAP_EXCEEDED_OWNER", "CAP_EXCEEDED_WALLET"):
>         # surface cap messaging
>         pass
>     else:
>         raise
> ```

***

## Related

* [SDK JS](https://docs.peaq.xyz/peaqos/sdk-reference/sdk-js.md)
* [SDK Python](https://docs.peaq.xyz/peaqos/sdk-reference/sdk-python.md)
* [Gas Station concept](https://docs.peaq.xyz/peaqos/concepts/gas-station.md)
* [Install page troubleshooting](https://docs.peaq.xyz/peaqos/install.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.