#[non_exhaustive]#[repr(i32)]pub enum ErrorCode {
Show 18 variants
ParseError = -32_700,
InvalidRequest = -32_600,
MethodNotFound = -32_601,
InvalidParams = -32_602,
InternalError = -32_603,
NotSynced = 10_001,
PeerUnauthorized = 10_002,
PermissionDenied = 10_003,
RateLimited = 10_004,
ResourceNotFound = 10_005,
SlashingGuardBlocked = 10_010,
InvalidSignature = 10_011,
InvalidProof = 10_012,
L1Unavailable = 10_020,
WalletLocked = 10_030,
ShutdownPending = 10_040,
NetworkMismatch = 10_050,
VersionMismatch = 10_051,
}Expand description
Stable JSON-RPC error code.
Serialises as a bare integer on the wire (via serde_repr) so values
are JSON-RPC-spec-compliant. The enum is #[non_exhaustive] so that
adding variants in minor releases is backwards-compatible — clients
built against an older dig-rpc-types must use _ => ... when
matching.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ParseError = -32_700
Invalid JSON was received by the server.
InvalidRequest = -32_600
The JSON sent is not a valid Request object.
MethodNotFound = -32_601
The method does not exist / is not available.
InvalidParams = -32_602
Invalid method parameter(s).
InternalError = -32_603
Internal JSON-RPC error.
NotSynced = 10_001
The fullnode is not yet synced to chain tip; the requested data may be stale or unavailable.
The peer’s certificate does not resolve to any known role (internal server only).
PermissionDenied = 10_003
The peer’s resolved role is below the method’s min_role.
RateLimited = 10_004
The peer exceeded its per-opcode token bucket.
ResourceNotFound = 10_005
The requested block / coin / validator was not found.
SlashingGuardBlocked = 10_010
The validator’s local slashing-protection DB would veto this signature (e.g., proposed-slot watermark, attested-target watermark).
InvalidSignature = 10_011
A provided BLS signature failed verification.
InvalidProof = 10_012
A provided Groth16 or other ZK proof failed verification.
Cannot reach Chia L1 (peer pool exhausted, no coinset fallback).
WalletLocked = 10_030
The wallet is locked; unlock before calling signing methods.
ShutdownPending = 10_040
Server is shutting down; retry against another peer.
NetworkMismatch = 10_050
The client’s advertised network id differs from the server’s.
VersionMismatch = 10_051
The client’s advertised schema major version differs from the server’s.
Implementations§
Source§impl ErrorCode
impl ErrorCode
Sourcepub fn code(self) -> i32
pub fn code(self) -> i32
Return the raw integer code.
Equivalent to self as i32; provided as an explicit method so
callers don’t rely on repr casting.
Sourcepub fn is_jsonrpc_reserved(self) -> bool
pub fn is_jsonrpc_reserved(self) -> bool
Whether this variant is in the JSON-RPC-reserved range.
Sourcepub fn is_dig_specific(self) -> bool
pub fn is_dig_specific(self) -> bool
Whether this variant is DIG-specific (1xxxx range).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ErrorCode
impl<'de> Deserialize<'de> for ErrorCode
Source§fn deserialize<D>(
deserializer: D,
) -> Result<ErrorCode, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ErrorCode, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl Serialize for ErrorCode
impl Serialize for ErrorCode
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl Copy for ErrorCode
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.