Enum ethers_contract::MulticallError
source · pub enum MulticallError<M: Middleware> {
ContractError(ContractError<M>),
InvalidChainId(u64),
IllegalRevert,
}providers and abigen only.Expand description
Errors using the crate::Multicall system
Variants§
ContractError(ContractError<M>)
Contract call returned an error
InvalidChainId(u64)
Unsupported chain
IllegalRevert
Contract call reverted when not allowed
Implementations§
source§impl<M: Middleware> MulticallError<M>
impl<M: Middleware> MulticallError<M>
sourcepub fn as_contract_error(&self) -> Option<&ContractError<M>>
pub fn as_contract_error(&self) -> Option<&ContractError<M>>
Convert a MulticallError to a the underlying error if possible.
sourcepub fn is_contract_error(&self) -> bool
pub fn is_contract_error(&self) -> bool
True if the underlying error is a ContractError
sourcepub fn as_middleware_error(&self) -> Option<&M::Error>
pub fn as_middleware_error(&self) -> Option<&M::Error>
Convert a MulticallError to a the underlying error if possible.
sourcepub fn is_middleware_error(&self) -> bool
pub fn is_middleware_error(&self) -> bool
True if the underlying error is a MiddlewareError
sourcepub fn as_provider_error(&self) -> Option<&ProviderError>
pub fn as_provider_error(&self) -> Option<&ProviderError>
Convert a MulticallError to a ProviderError if possible.
sourcepub fn is_provider_error(&self) -> bool
pub fn is_provider_error(&self) -> bool
True if the error is a provider error
sourcepub fn as_revert(&self) -> Option<&Bytes>
pub fn as_revert(&self) -> Option<&Bytes>
If this MulticallError is a revert, this method will retrieve a
reference to the underlying revert data. This ABI-encoded data could be
a String, or a custom Solidity error type.
Returns
None if the error is not a revert
Some(data) with the revert data, if the error is a revert
Note
To skip this step, consider using MulticallError::decode_revert
sourcepub fn decode_revert<Err: EthError>(&self) -> Option<Err>
pub fn decode_revert<Err: EthError>(&self) -> Option<Err>
Decode revert data into an EthError type. Returns None if
decoding fails, or if this is not a revert