pub enum CowError {
UnknownAsset(String),
Api {
status: u16,
body: String,
},
Http(Error),
Signing(String),
ZeroQuantity,
Parse {
field: &'static str,
reason: String,
},
AppData(String),
Rpc {
code: i64,
message: String,
},
Unsupported {
message: String,
},
Config(String),
}Expand description
Errors that can occur when interacting with the CoW Protocol SDK.
This is the unified error type returned by every fallible function in
the crate. Each variant carries enough context to produce a useful
diagnostic message via its Display
implementation.
Variants§
UnknownAsset(String)
The asset symbol is not in the TokenRegistry.
Api
The CoW Protocol API returned a non-2xx response.
Http(Error)
An HTTP transport error from reqwest.
Signing(String)
EIP-712 signing failed.
ZeroQuantity
The signal quantity is zero — nothing to trade.
Parse
A required field in a quote or order response could not be parsed.
Fields
AppData(String)
App-data encoding or hashing failed.
Rpc
A JSON-RPC error returned by an Ethereum node.
Fields
Unsupported
A feature or provider is not supported on the current chain or configuration.
Config(String)
SDK configuration error (e.g. missing global adapter).
Trait Implementations§
Source§impl Error for CowError
impl Error for CowError
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()
Source§impl From<CowError> for BridgeError
impl From<CowError> for BridgeError
Auto Trait Implementations§
impl Freeze for CowError
impl !RefUnwindSafe for CowError
impl Send for CowError
impl Sync for CowError
impl Unpin for CowError
impl UnsafeUnpin for CowError
impl !UnwindSafe for CowError
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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.