Skip to main content

Module error

Module error 

Source
Expand description

The canonical DIG-node RPC error taxonomy.

This module is the single definition point for every error code the DIG node RPC surface emits, the canonical RpcError envelope ({code, message, data:{code, origin}}), and the one constructor helper both node implementations call so every error carries a machine-branchable data.code and data.origin.

§The code set

Standard JSON-RPC 2.0 codes plus the DIG protocol-specific codes. The numeric values are a published wire contract and never change once assigned.

CodeVariantOriginMeaning
-32700ParseErrorNoderequest body is not valid JSON
-32600InvalidRequestNodenot a valid Request object
-32601MethodNotFoundNodemethod not implemented
-32602InvalidParamsNodemissing/malformed params
-32603InternalErrorNodewell-formed call failed
-32000ServerErrorNodegeneric server error
-32004ResourceUnavailableNoderesource not available at the requested root (genuine infra miss)
-32005RootNotAnchoredNoderequested/served root is not the chain-anchored root (fail-closed pin)
-32006PeerUnreachableNodeno NAT-traversal strategy reached the peer
-32007RangeNotSatisfiableNodebyte range lies outside the resource
-32008ContentRedirectNodecontent held elsewhere — data.redirect names holders
-32010UpstreamErrorUpstreaman upstream/proxy fetch failed
-32011StageInvalidInputNodedig.stage: dir unreadable / walk budget exceeded
-32012StageNoFilesNodedig.stage: no files to compile
-32013StageOverCapNodedig.stage: input exceeds the store cap
-32014StageCompileFailedNodedig.stage: compile / IO failure
-32020OnionCircuitUnavailableOnionprivate read could not build/keep a circuit
-32021PrivacyRequiresLocalNodeOnionprivacy mode requires the caller be a local originator
-32022OnionHopsOutOfRangeOnionrequested hop count outside [2, 5]
-32030UnauthorizedControlcontrol-plane call is not authorized
-32031NotSupportedControlcontrol-plane method not supported here
-32032ControlErrorControlcontrol-plane runtime error

§The -32020..-32022 collision, resolved

The published normative protocol (docs.dig.net) assigns -32020/-32021/-32022 to the onion (private-retrieval) failures. Those keep their numbers. The control-plane errors that previously squatted the same values are renumbered to -32030/-32031/-32032.

Structs§

ErrorData
Structured error context carried in error.data.
RpcError
The canonical DIG-node RPC error object: {code, message, data:{code, origin}}.

Enums§

ErrorCode
A canonical DIG-node RPC error code.
ErrorOrigin
The subsystem a failure arose in — carried in data.origin so a client can route the error (retry upstream, rebuild a circuit, re-auth the control plane) without parsing the message.