summaryrefslogtreecommitdiffstats
path: root/src/logging
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2022-11-20 13:34:23 -0600
committerToby Vincent <tobyv13@gmail.com>2022-11-20 13:35:06 -0600
commit4b182e71598c2eda5190b81708bafe6f9681999b (patch)
tree7c0d906cf5fec687e2a7e551943b9277f330f085 /src/logging
parent597c19dfc08eae940a100a44a009d3169a6568f2 (diff)
feat: improve error handling
Diffstat (limited to 'src/logging')
-rw-r--r--src/logging/error.rs10
-rw-r--r--src/logging/level.rs1
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)
}
-