1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use thiserror::Error;

#[derive(Debug, Error)]
pub enum Error {
    #[error("{0}")]
    Subxt(#[from] substrate_subxt::Error),
    #[cfg(feature = "light-client")]
    #[error("{0}")]
    Service(#[from] substrate_subxt_light_client::ServiceError),
    #[error("{0}")]
    Sled(#[from] sled::Error),
    #[error("{0}")]
    Ipfs(#[from] ipfs_embed::Error),
    #[error(transparent)]
    Keystore(#[from] keystore::Error),
    #[error("keystore already initialized")]
    KeystoreInitialized,
    #[error("event not found")]
    EventNotFound,
    #[error("Account ID cannot be parsed from string.")]
    AccountIdParseFail,
    #[error("Number cannot be parsed from string")]
    ParseIntError,
}

pub type Result<T> = core::result::Result<T, Error>;