hopr_chain_types/
errors.rs1#[cfg(feature = "use-bindings")]
2use hopr_bindings::exports::alloy::{contract::Error as ContractError, signers::Error as SignerError};
3
4pub type Result<T, E = ChainTypesError> = core::result::Result<T, E>;
6
7#[derive(thiserror::Error, Debug)]
9pub enum ChainTypesError {
10 #[error("invalid state: {0}")]
11 InvalidState(&'static str),
12
13 #[error("invalid arguments: {0}")]
14 InvalidArguments(&'static str),
15
16 #[error("signing error: {0}")]
17 SigningError(#[source] anyhow::Error),
18
19 #[cfg(feature = "use-bindings")]
21 #[error(transparent)]
22 SignerError(#[from] SignerError),
23
24 #[cfg(feature = "use-bindings")]
26 #[error(transparent)]
27 ContractError(#[from] ContractError),
28
29 #[error("error while parsing an EIP-2718 transaction: {0}")]
31 ParseError(#[source] anyhow::Error),
32}