#[non_exhaustive]pub enum ClientError {
Builder(String),
Http(Error),
Decode(Error),
ProtocolError {
code: u16,
msg: String,
},
Signature(String),
SignatureMismatch {
expected: String,
recovered: String,
},
InvalidKey(String),
WebSocket(String),
Validation(String),
}Expand description
The single error type returned by every fallible operation in this SDK.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Builder(String)
Client setup failure (bad URL, TLS init, etc.).
Http(Error)
HTTP transport failure (connection refused, timeout, etc.).
Decode(Error)
JSON encode / decode failure.
ProtocolError
The server returned an error envelope with a code + message.
code is the HTTP status code; msg is the error field from the
MTF-native error envelope ({"error": "..."}).
Fields
Signature(String)
EIP-712 signature production failed.
SignatureMismatch
The signature recovered does not match the wallet’s address.
This indicates an internal bug — the SDK signed a message but recovering the signer from the digest + signature did not yield the expected address. Should never happen in practice.
Fields
InvalidKey(String)
Private key parsing failed (wrong length / not hex / out of curve).
WebSocket(String)
WebSocket transport failure.
Validation(String)
User input failed local validation before any network call.
Trait Implementations§
Source§impl Debug for ClientError
impl Debug for ClientError
Source§impl Display for ClientError
impl Display for ClientError
Source§impl Error for ClientError
impl Error for ClientError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()