pub enum FyndError {
Http(Error),
Provider(RpcError<TransportErrorKind>),
Api {
code: ErrorCode,
message: String,
},
Protocol(String),
SimulationFailed(String),
TransactionReverted(String),
Config(String),
}Expand description
Errors that can be returned by FyndClient methods.
Variants§
Http(Error)
An HTTP-level error from the underlying reqwest client (network failure, timeout, etc.).
HTTP errors are always considered retryable.
Provider(RpcError<TransportErrorKind>)
An error returned by the Ethereum JSON-RPC provider (e.g. during nonce/fee estimation or transaction submission).
Api
A structured error response from the Fynd RPC API. Check code to distinguish permanent
failures (e.g. NoRouteFound) from transient ones (e.g. SolveTimeout).
Protocol(String)
Malformed or unexpected data in the API response (e.g. an address with the wrong byte length, an unrecognised enum variant).
SimulationFailed(String)
A eth_call simulation of the swap transaction reverted. The message contains the
revert reason when available.
TransactionReverted(String)
An on-chain transaction was mined but reverted. The message contains the revert reason
decoded from replaying the transaction via eth_call.
Config(String)
Invalid client configuration (e.g. unparseable URL, missing sender address).
Implementations§
Trait Implementations§
Source§impl Error for FyndError
impl Error for FyndError
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()
Auto Trait Implementations§
impl Freeze for FyndError
impl !RefUnwindSafe for FyndError
impl Send for FyndError
impl Sync for FyndError
impl Unpin for FyndError
impl UnsafeUnpin for FyndError
impl !UnwindSafe for FyndError
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.