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.
| Code | Variant | Origin | Meaning |
|---|---|---|---|
-32700 | ParseError | Node | request body is not valid JSON |
-32600 | InvalidRequest | Node | not a valid Request object |
-32601 | MethodNotFound | Node | method not implemented |
-32602 | InvalidParams | Node | missing/malformed params |
-32603 | InternalError | Node | well-formed call failed |
-32000 | ServerError | Node | generic server error |
-32004 | ResourceUnavailable | Node | resource not available at the requested root (genuine infra miss) |
-32005 | RootNotAnchored | Node | requested/served root is not the chain-anchored root (fail-closed pin) |
-32006 | PeerUnreachable | Node | no NAT-traversal strategy reached the peer |
-32007 | RangeNotSatisfiable | Node | byte range lies outside the resource |
-32008 | ContentRedirect | Node | content held elsewhere — data.redirect names holders |
-32010 | UpstreamError | Upstream | an upstream/proxy fetch failed |
-32011 | StageInvalidInput | Node | dig.stage: dir unreadable / walk budget exceeded |
-32012 | StageNoFiles | Node | dig.stage: no files to compile |
-32013 | StageOverCap | Node | dig.stage: input exceeds the store cap |
-32014 | StageCompileFailed | Node | dig.stage: compile / IO failure |
-32020 | OnionCircuitUnavailable | Onion | private read could not build/keep a circuit |
-32021 | PrivacyRequiresLocalNode | Onion | privacy mode requires the caller be a local originator |
-32022 | OnionHopsOutOfRange | Onion | requested hop count outside [2, 5] |
-32030 | Unauthorized | Control | control-plane call is not authorized |
-32031 | NotSupported | Control | control-plane method not supported here |
-32032 | ControlError | Control | control-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§
- Error
Data - Structured error context carried in
error.data. - RpcError
- The canonical DIG-node RPC error object:
{code, message, data:{code, origin}}.
Enums§
- Error
Code - A canonical DIG-node RPC error code.
- Error
Origin - The subsystem a failure arose in — carried in
data.originso a client can route the error (retry upstream, rebuild a circuit, re-auth the control plane) without parsing the message.