Skip to main content

Module errors

Module errors 

Source
Expand description

Stable JSON-RPC error codes.

§Contract

Once a variant is assigned a numeric value, that value never changes. New variants append to the enum at the next unused integer. The enum is #[non_exhaustive] so clients built against an older version don’t panic on a newer server’s new code.

§Ranges

  • -32768..=-32000 — reserved by JSON-RPC 2.0. We use the spec-defined pre-defined values (ParseError, InvalidRequest, MethodNotFound, InvalidParams, InternalError).
  • 10000.. — DIG-reserved. Sub-allocated by concern:
    • 10001..=10009 — sync / auth / permission
    • 10010..=10019 — cryptographic checks
    • 10020..=10029 — L1 (Chia) issues
    • 10030..=10039 — wallet state
    • 10040..=10049 — lifecycle
    • 10050..=10059 — protocol / version

§References

Enums§

ErrorCode
Stable JSON-RPC error code.