Enum ethers_providers::ProviderError
source · pub enum ProviderError {
JsonRpcClientError(Box<dyn RpcError + Send + Sync>),
EnsError(String),
EnsNotOwned(String),
SerdeJson(Error),
HexError(FromHexError),
HTTPError(Error),
CustomError(String),
UnsupportedRPC,
UnsupportedNodeClient,
SignerUnavailable,
}
Expand description
An error thrown when making a call to the provider
Variants§
JsonRpcClientError(Box<dyn RpcError + Send + Sync>)
An internal error in the JSON RPC Client
EnsError(String)
An error during ENS name resolution
EnsNotOwned(String)
Invalid reverse ENS name
SerdeJson(Error)
Error in underlying lib serde_json
HexError(FromHexError)
Error in underlying lib hex
HTTPError(Error)
Error in underlying lib reqwest
CustomError(String)
Custom error from unknown source
UnsupportedRPC
RPC method is not supported by this provider
UnsupportedNodeClient
Node is not supported by this provider
Signer is not available to this provider.
Trait Implementations§
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
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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<ClientError> for ProviderError
Available on crate feature legacy-ws
only.
impl From<ClientError> for ProviderError
Available on crate feature
legacy-ws
only.source§fn from(src: ClientError) -> Self
fn from(src: ClientError) -> Self
Converts to this type from the input type.
source§impl From<ClientError> for ProviderError
impl From<ClientError> for ProviderError
source§fn from(src: ClientError) -> Self
fn from(src: ClientError) -> Self
Converts to this type from the input type.
source§impl From<Error> for ProviderError
impl From<Error> for ProviderError
source§impl From<Error> for ProviderError
impl From<Error> for ProviderError
source§impl From<FromHexError> for ProviderError
impl From<FromHexError> for ProviderError
source§fn from(source: FromHexError) -> Self
fn from(source: FromHexError) -> Self
Converts to this type from the input type.
source§impl From<IpcError> for ProviderError
Available on crate feature ipc
and (Unix or Windows) only.
impl From<IpcError> for ProviderError
Available on crate feature
ipc
and (Unix or Windows) only.source§impl From<MockError> for ProviderError
impl From<MockError> for ProviderError
source§impl<M> From<ProviderError> for DevRpcMiddlewareError<M>where
M: Middleware,
Available on crate feature dev-rpc
only.
impl<M> From<ProviderError> for DevRpcMiddlewareError<M>where
M: Middleware,
Available on crate feature
dev-rpc
only.source§fn from(src: ProviderError) -> Self
fn from(src: ProviderError) -> Self
Converts to this type from the input type.
source§impl From<QuorumError> for ProviderError
impl From<QuorumError> for ProviderError
source§fn from(src: QuorumError) -> Self
fn from(src: QuorumError) -> Self
Converts to this type from the input type.
source§impl From<RetryClientError> for ProviderError
impl From<RetryClientError> for ProviderError
source§fn from(src: RetryClientError) -> Self
fn from(src: RetryClientError) -> Self
Converts to this type from the input type.
source§impl<Read, Write> From<RwClientError<Read, Write>> for ProviderErrorwhere
Read: JsonRpcClient + 'static,
<Read as JsonRpcClient>::Error: Sync + Send + 'static,
Write: JsonRpcClient + 'static,
<Write as JsonRpcClient>::Error: Sync + Send + 'static,
impl<Read, Write> From<RwClientError<Read, Write>> for ProviderErrorwhere
Read: JsonRpcClient + 'static,
<Read as JsonRpcClient>::Error: Sync + Send + 'static,
Write: JsonRpcClient + 'static,
<Write as JsonRpcClient>::Error: Sync + Send + 'static,
source§fn from(src: RwClientError<Read, Write>) -> Self
fn from(src: RwClientError<Read, Write>) -> Self
Converts to this type from the input type.
source§impl MiddlewareError for ProviderError
impl MiddlewareError for ProviderError
§type Inner = ProviderError
type Inner = ProviderError
The
Inner
type is the next lower middleware layer’s error type.source§fn as_error_response(&self) -> Option<&JsonRpcError>
fn as_error_response(&self) -> Option<&JsonRpcError>
Access an underlying JSON-RPC error (if any) Read more
source§fn as_serde_error(&self) -> Option<&Error>
fn as_serde_error(&self) -> Option<&Error>
Access an underlying
serde_json
error (if any) Read moresource§fn from_err(e: Self::Inner) -> Self
fn from_err(e: Self::Inner) -> Self
Convert the next lower middleware layer’s error to this layer’s error
source§fn as_inner(&self) -> Option<&Self::Inner>
fn as_inner(&self) -> Option<&Self::Inner>
Attempt to convert this error to the next lower middleware’s error.
Conversion fails if the error is not from an inner layer (i.e. the
error originates at this middleware layer)
source§fn is_inner(&self) -> bool
fn is_inner(&self) -> bool
Returns
true
if the underlying error stems from a lower middleware
layersource§fn is_serde_error(&self) -> bool
fn is_serde_error(&self) -> bool
Returns
true
if the underlying error is a serde_json (de)serialization
error. This method can be used to identifysource§fn as_provider_error(&self) -> Option<&ProviderError>
fn as_provider_error(&self) -> Option<&ProviderError>
Attempts to access an underlying
ProviderError
, usually by
traversing the entire middleware stack. Access fails if the underlying
error is not a ProviderError
source§fn from_provider_err(p: ProviderError) -> Self
fn from_provider_err(p: ProviderError) -> Self
Convert a
ProviderError
to this type, by successively wrapping it
in the error types of all lower middlewaresource§fn is_error_response(&self) -> bool
fn is_error_response(&self) -> bool
Returns
true
if the underlying error is a JSON-RPC error responsesource§impl RpcError for ProviderError
impl RpcError for ProviderError
source§fn as_error_response(&self) -> Option<&JsonRpcError>
fn as_error_response(&self) -> Option<&JsonRpcError>
Access an underlying JSON-RPC error (if any) Read more
source§fn as_serde_error(&self) -> Option<&Error>
fn as_serde_error(&self) -> Option<&Error>
Access an underlying
serde_json
error (if any) Read moresource§fn is_error_response(&self) -> bool
fn is_error_response(&self) -> bool
Returns
true
if the underlying error is a JSON-RPC error responsesource§fn is_serde_error(&self) -> bool
fn is_serde_error(&self) -> bool
Returns
true
if the underlying error is a serde_json (de)serialization
error. This method can be used to identifyAuto Trait Implementations§
impl !RefUnwindSafe for ProviderError
impl Send for ProviderError
impl Sync for ProviderError
impl Unpin 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
Mutably borrows from an owned value. Read more