1use thiserror::Error;
2
3#[derive(Error, Debug)]
6pub enum HoprChainError {
7 #[error("API error: {0}")]
8 Api(String),
9
10 #[error("rpc error: {0}")]
11 Rpc(#[from] hopr_chain_rpc::errors::RpcError),
12
13 #[error("indexer error: {0}")]
14 Indexer(#[from] hopr_chain_indexer::errors::CoreEthereumIndexerError),
15
16 #[error(transparent)]
17 DbError(#[from] hopr_db_sql::errors::DbSqlError),
18
19 #[error("configuration error: {0}")]
20 Configuration(String),
21}
22
23pub type Result<T> = core::result::Result<T, HoprChainError>;