1#[derive(thiserror::Error, Debug)]
18pub enum Error {
19 #[error(transparent)]
20 PolkadotService(#[from] polkadot_service::Error),
21
22 #[error(transparent)]
23 SubstrateCli(#[from] sc_cli::Error),
24
25 #[error(transparent)]
26 SubstrateService(#[from] sc_service::Error),
27
28 #[error(transparent)]
29 SubstrateTracing(#[from] sc_tracing::logging::Error),
30
31 #[cfg(not(feature = "pyroscope"))]
32 #[error("Binary was not compiled with `--feature=pyroscope`")]
33 PyroscopeNotCompiledIn,
34
35 #[cfg(feature = "pyroscope")]
36 #[error("Failed to connect to pyroscope agent")]
37 PyroscopeError(#[from] pyroscope::error::PyroscopeError),
38
39 #[error("Failed to resolve provided URL")]
40 AddressResolutionFailure(#[from] std::io::Error),
41
42 #[error("URL did not resolve to anything")]
43 AddressResolutionMissing,
44
45 #[error("Command is not implemented")]
46 CommandNotImplemented,
47
48 #[error(transparent)]
49 Storage(#[from] sc_storage_monitor::Error),
50
51 #[error("Other: {0}")]
52 Other(String),
53
54 #[error("This subcommand is only available when compiled with `{feature}`")]
55 FeatureNotEnabled { feature: &'static str },
56}
57
58impl From<String> for Error {
59 fn from(s: String) -> Self {
60 Self::Other(s)
61 }
62}