#[non_exhaustive]pub enum SDKError {
Show 20 variants
InvalidNetwork,
InvalidPrivateKey(String),
JsonSerializeError(Error),
HttpError(Error),
ApiError(Box<ApiErrorResponse>),
RequestError(String),
MissingKeypair,
StringParseError(FromUtf8Error),
ChainIdCastError(TryFromIntError),
InvalidNetworkUrl,
InvalidSchemaResponse(&'static str),
InvalidChainHash(String),
SerializationError(String),
SystemTimeError,
InvalidSignatureLength(usize),
InvalidPublicKeyLength(usize),
SchemaOutdated,
UnsupportedCallMessage(String),
TransactionOutdated,
WebsocketError(Box<WSErrors>),
}Expand description
Errors that can occur when using the Trading SDK.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidNetwork
Invalid network configuration.
InvalidPrivateKey(String)
Invalid private key format or length.
JsonSerializeError(Error)
JSON serialization error.
HttpError(Error)
HTTP client error.
ApiError(Box<ApiErrorResponse>)
Structured API error from the trading API.
Boxed because ApiErrorResponse carries optional details + error_id
strings and a nested enum, making the variant large enough to bloat
every SDKResult<T> on the stack (clippy::result_large_err). Boxing
pushes the cost to error-construction time (negligible — happy paths
don’t allocate) and keeps Result types cheap to pass around.
RequestError(String)
Client-side request error (not from the server).
MissingKeypair
No keypair available for signing.
StringParseError(FromUtf8Error)
ChainIdCastError(TryFromIntError)
InvalidNetworkUrl
InvalidSchemaResponse(&'static str)
InvalidChainHash(String)
SerializationError(String)
SystemTimeError
InvalidSignatureLength(usize)
InvalidPublicKeyLength(usize)
SchemaOutdated
UnsupportedCallMessage(String)
TransactionOutdated
WebsocketError(Box<WSErrors>)
Implementations§
Source§impl SDKError
impl SDKError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether this error is potentially transient and the operation could be retried with backoff.
Sourcepub fn api_error(&self) -> Option<&ApiErrorResponse>
pub fn api_error(&self) -> Option<&ApiErrorResponse>
If this is an API error, returns the structured response.
Trait Implementations§
Source§impl Error for SDKError
impl Error for SDKError
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()