summaryrefslogtreecommitdiffstats
path: root/filetreelist/src/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'filetreelist/src/error.rs')
-rw-r--r--filetreelist/src/error.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/filetreelist/src/error.rs b/filetreelist/src/error.rs
new file mode 100644
index 00000000..a68fcaf3
--- /dev/null
+++ b/filetreelist/src/error.rs
@@ -0,0 +1,16 @@
+use std::{num::TryFromIntError, path::PathBuf};
+use thiserror::Error;
+
+#[derive(Error, Debug)]
+pub enum Error {
+ #[error("InvalidPath: `{0}`")]
+ InvalidPath(PathBuf),
+
+ #[error("InvalidFilePath: `{0}`")]
+ InvalidFilePath(String),
+
+ #[error("TryFromInt error:{0}")]
+ IntConversion(#[from] TryFromIntError),
+}
+
+pub type Result<T> = std::result::Result<T, Error>;