cli_config/
error.rs

1#[derive(Debug, thiserror::Error)]
2pub enum Error {
3    #[error("cannot find file")]
4    FileNotFound,
5
6    #[error("invalid config: {0}")]
7    InvalidConfig(&'static str),
8
9    #[cfg(feature = "json")]
10    #[error("invalid json: {0}")]
11    JSON(#[from] serde_json::Error),
12
13    #[cfg(feature = "yaml")]
14    #[error("invalid yaml: {0}")]
15    YAML(#[from] serde_yaml::Error),
16
17    #[cfg(feature = "toml")]
18    #[error("invalid toml: {0}")]
19    TOML(#[from] toml::de::Error),
20
21    #[cfg(feature = "toml")]
22    #[error("cannot serialize: {0}")]
23    TomlWrite(#[from] toml::ser::Error),
24
25    #[error("FileSystem error")]
26    FileSystem(#[from] std::io::Error),
27
28    #[error("the theme you are looking for does not exists")]
29    ThemeNotFound,
30
31    #[error("{0}")]
32    Custom(&'static str),
33
34    #[error("something went wrong: {0}")]
35    Generic(#[from] anyhow::Error),
36}