diff options
author | Toby Vincent <tobyv13@gmail.com> | 2022-11-20 13:34:23 -0600 |
---|---|---|
committer | Toby Vincent <tobyv13@gmail.com> | 2022-11-20 13:35:06 -0600 |
commit | 4b182e71598c2eda5190b81708bafe6f9681999b (patch) | |
tree | 7c0d906cf5fec687e2a7e551943b9277f330f085 /src/logging | |
parent | 597c19dfc08eae940a100a44a009d3169a6568f2 (diff) |
feat: improve error handling
Diffstat (limited to 'src/logging')
-rw-r--r-- | src/logging/error.rs | 10 | ||||
-rw-r--r-- | src/logging/level.rs | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/logging/error.rs b/src/logging/error.rs new file mode 100644 index 0000000..a38cdda --- /dev/null +++ b/src/logging/error.rs @@ -0,0 +1,10 @@ +pub type Result<T> = std::result::Result<T, Error>; + +#[derive(thiserror::Error, Debug)] +pub enum Error { + #[error(transparent)] + Config(#[from] figment::error::Error), + + #[error(transparent)] + IO(#[from] std::io::Error), +} diff --git a/src/logging/level.rs b/src/logging/level.rs index 6134c24..38a0f7f 100644 --- a/src/logging/level.rs +++ b/src/logging/level.rs @@ -19,4 +19,3 @@ where }; s.parse().map_err(serde::de::Error::custom).map(Some) } - |