#[non_exhaustive]pub enum ProviderError {
Show 18 variants
Timeout {
message: String,
},
RateLimited {
message: String,
},
ConnectionFailed {
message: String,
},
InvalidResponse {
message: String,
},
RpcError {
code: i64,
message: String,
},
ExecutionReverted {
code: i64,
message: String,
},
InvalidBlockRange {
from: u64,
to: u64,
},
InvalidAddress {
address: String,
reason: String,
},
InvalidTopic {
topic: String,
reason: String,
},
InvalidParams {
message: String,
},
AnvilError {
message: String,
},
InvalidAbi {
message: String,
},
EncodingError {
message: String,
},
DecodingError {
message: String,
},
SerializationError {
message: String,
},
SubscriptionNotSupported {
message: String,
},
ChainMismatch {
expected: u64,
actual: u64,
endpoint: String,
},
Other {
message: String,
},
}Expand description
Errors that can occur during provider operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Timeout
Request timeout.
RateLimited
Rate limit exceeded.
ConnectionFailed
Connection failed.
InvalidResponse
Invalid response from RPC.
RpcError
RPC error with code and message.
ExecutionReverted
An EVM execution revert reported by the provider (eth_call/
eth_estimateGas). Replaces the string-scraping the Python adapter seam
(degenbot.provider.alloy_errors) used to perform: the JSON-RPC error
code (-32000 Geth/Alchemy, -3 Anvil, etc.) is preserved alongside
the message so the FFI layer can raise the degenbot-owned
ContractLogicError structurally rather than by marker substring.
InvalidBlockRange
Invalid block range.
InvalidAddress
Invalid Ethereum address format.
InvalidTopic
Invalid topic format.
InvalidParams
Invalid parameters.
AnvilError
Anvil-specific error.
InvalidAbi
Invalid ABI.
EncodingError
Encoding error.
DecodingError
Decoding error.
SerializationError
Serialization error.
SubscriptionNotSupported
Subscription not supported (e.g., HTTP transport).
ChainMismatch
The endpoint serves a different chain than the one it was bound to.
Binding an endpoint to a chain reads eth_chainId once and refuses a
disagreement here, before any pool or token I/O runs against a node
that is not the chain the session declared. Not retryable: the same
endpoint will keep answering with the same chain.
Fields
Other
Other error.
Implementations§
Source§impl ProviderError
impl ProviderError
Sourcepub const fn is_retryable(&self) -> bool
pub const fn is_retryable(&self) -> bool
Returns true if this error is retryable (rate-limited, timeout, connection failure).
Used by the retry-with-backoff loop to decide whether to sleep and retry or surface the error immediately.
Trait Implementations§
Source§impl Clone for ProviderError
impl Clone for ProviderError
Source§impl Debug for ProviderError
impl Debug for ProviderError
Source§impl Display for ProviderError
impl Display for ProviderError
Source§impl Error for ProviderError
impl Error for ProviderError
1.30.0 · 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<ContractError> for ProviderError
impl From<ContractError> for ProviderError
Source§fn from(err: ContractError) -> Self
fn from(err: ContractError) -> Self
Auto Trait Implementations§
impl Freeze for ProviderError
impl RefUnwindSafe for ProviderError
impl Send for ProviderError
impl Sync for ProviderError
impl Unpin for ProviderError
impl UnsafeUnpin for ProviderError
impl UnwindSafe for ProviderError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more