diff options
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs new file mode 100644 index 0000000..9aa8c08 --- /dev/null +++ b/src/error.rs | |||
@@ -0,0 +1,19 @@ | |||
1 | use std::fmt::Debug; | ||
2 | |||
3 | pub enum CliError { | ||
4 | Reqwest(reqwest::Error), | ||
5 | Config(config::ConfigError), | ||
6 | Serde(serde_json::Error), | ||
7 | // Cli(Box<dyn std::error::Error>), | ||
8 | } | ||
9 | |||
10 | impl Debug for CliError { | ||
11 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
12 | match self { | ||
13 | Self::Reqwest(err) => { err.fmt(f) }, | ||
14 | Self::Config(err) => { err.fmt(f) }, | ||
15 | Self::Serde(err) => { err.fmt(f) }, | ||
16 | // Self::Cli(err) => {err.fmt(f)}, | ||
17 | } | ||
18 | } | ||
19 | } | ||