fireblocks_config/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum Error {
5    #[error("config not found {0}")]
6    ConfigNotFound(String),
7
8    #[error(transparent)]
9    ConfigParseError(#[from] config::ConfigError),
10
11    #[error(transparent)]
12    IO(#[from] std::io::Error),
13
14    #[error("missing secret key. Check your configuration file or set env FIREBLOCKS_SECRET")]
15    MissingSecret,
16
17    #[error("{asset} not found")]
18    AssetNotFound { asset: String },
19
20    #[error("IO error for file {path:?}: {source}")]
21    IOError {
22        source: std::io::Error,
23        path: String,
24    },
25
26    #[error("Invalid Duration {0}")]
27    InvalidDuration(String),
28
29    #[error("Key '{key}' not present in configuration")]
30    NotPresent { key: String },
31
32    #[cfg(feature = "gpg")]
33    #[error(transparent)]
34    GpgError(#[from] gpgme::Error),
35
36    #[error("XDG config directory not found")]
37    XdgConfigNotFound,
38
39    #[error("Profile config not found: {0}")]
40    ProfileConfigNotFound(String),
41}