#[non_exhaustive]pub enum SDKError {
Show 20 variants
InvalidNetwork,
InvalidPrivateKey(String),
JsonSerializeError(Error),
HttpError(Error),
ApiError(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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidNetwork
Invalid network configuration.
InvalidPrivateKey(String)
Invalid private key format or length.
JsonSerializeError(Error)
JSON serialization error.
HttpError(Error)
HTTP client error.
ApiError(ApiErrorResponse)
Structured API error from the trading API.
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Error<ApiErrorResponse>> for SDKError
impl From<Error<ApiErrorResponse>> for SDKError
Source§fn from(err: Error<ApiErrorResponse>) -> Self
fn from(err: Error<ApiErrorResponse>) -> Self
Converts to this type from the input type.
Source§impl From<FromUtf8Error> for SDKError
impl From<FromUtf8Error> for SDKError
Source§fn from(source: FromUtf8Error) -> Self
fn from(source: FromUtf8Error) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SDKError
impl !RefUnwindSafe for SDKError
impl Send for SDKError
impl Sync for SDKError
impl Unpin for SDKError
impl UnsafeUnpin for SDKError
impl !UnwindSafe for SDKError
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.