hopr_chain_indexer/
errors.rs

1use ethers::core::abi::Error as AbiError;
2use thiserror::Error;
3
4use hopr_primitive_types::{errors::GeneralError, primitives::Address};
5
6#[derive(Error, Debug)]
7pub enum CoreEthereumIndexerError {
8    #[error("{0}")]
9    ProcessError(String),
10
11    #[error(transparent)]
12    DbApiError(#[from] hopr_db_sql::errors::DbSqlError),
13
14    #[error(transparent)]
15    DbError(#[from] hopr_db_sql::api::errors::DbError),
16
17    #[error(transparent)]
18    DbEntityError(#[from] hopr_db_entity::errors::DbEntityError),
19
20    #[error(transparent)]
21    AbiError(#[from] AbiError),
22
23    #[error(transparent)]
24    GeneralError(#[from] GeneralError),
25
26    #[error("{0}")]
27    ValidationError(String),
28
29    #[error("Address announcement without a preceding key binding.")]
30    AnnounceBeforeKeyBinding,
31
32    #[error("Address announcement contains empty Multiaddr.")]
33    AnnounceEmptyMultiaddr,
34
35    #[error("Node has already announced a key binding. Reassigning keys is not supported.")]
36    UnsupportedKeyRebinding,
37
38    #[error("Address revocation before key binding.")]
39    RevocationBeforeKeyBinding,
40
41    #[error("Could not verify account entry signature. Maybe a cross-signing issue?")]
42    AccountEntrySignatureVerification,
43
44    #[error("Received an event for a channel that is closed or for which we haven't seen an OPEN event.")]
45    ChannelDoesNotExist,
46
47    #[error("Cannot deregister non-existent MFA module")]
48    MFAModuleDoesNotExist,
49
50    #[error("Unknown smart contract. Received event from {0}")]
51    UnknownContract(Address),
52
53    #[error(transparent)]
54    MultiaddrParseError(#[from] multiaddr::Error),
55
56    #[error(transparent)]
57    RpcError(#[from] hopr_chain_rpc::errors::RpcError),
58}
59
60pub type Result<T> = core::result::Result<T, CoreEthereumIndexerError>;