Skip to main content
Every error raised by the extends a common base. Faucet-specific codes are surfaced on the error instance (error.code) so callers can branch without string matching.

Class hierarchy

These four extend PeaqosError directly. Each function area adds its own family alongside them, also extending PeaqosError: MonetizationError, ProvisioningError, StreamError, and OrchestrationError. So catch (err instanceof PeaqosError) covers every SDK error; catching RuntimeError alone will miss ValueCapExceeded and RateLimitExceeded.

Faucet error codes

All 20 codes the can return from POST /faucet/fund, POST /2fa/setup, and POST /2fa/confirm. Each endpoint returns a subset. For example, INVALID_OWNER_ADDRESS and QR_GENERATION_FAILED only come from /2fa/setup. Codes surface as RuntimeError.code (JS) or ApiError.code (Python).
Full flow reference: Gas Station concept, setupFaucet2FA, fund_from_gas_station.

On-chain revert names

names the SDK translates to a friendly message and surfaces as RuntimeError.code (JS) or RpcError.code (Python). The contracts define more custom errors than this table; anything not listed surfaces as code: "TX_REVERTED" (Python) or code: "<RawErrorName>" with a generic Transaction reverted: … message (JS, when viem decodes the selector).

MCR API error codes

Returned by queryMcr / query_mcr, queryMachine / query_machine, and queryOperatorMachines / query_operator_machines. Surfaced as RuntimeError.code (JS) or ApiError.code (Python).

OWS signing error codes

Raised when routes through an (PeaqosClient.fromWallet / from_wallet with owsSigning=true). The SDK normalises the upstream OWS error code into a typed SDK exception — only INVALID_INPUT becomes ValidationError; the other four become PeaqosError (or RuntimeError in JS) with the original OWS error preserved as .cause. Constants exported from both SDKs 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.

SDK transaction sentinels

Raised by the SDK’s transaction helper around any contract call. Surfaced as RuntimeError.code (JS) or RpcError.code (Python).

Faucet / HTTP envelope sentinels

Raised by the SDK when a faucet or MCR response is reachable but unparseable. Surfaced as ApiError.code (Python). The JS SDK collapses these into the generic RuntimeError envelope path.

Client-side error codes

Raised by the SDK itself (not by a chain revert). Surfaced as RuntimeError.code (JS) or ValidationError/RpcError attributes (Python).

Error handling patterns