summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/error.rs21
-rw-r--r--src/lib.rs2
2 files changed, 23 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
new file mode 100644
index 0000000..0183e38
--- /dev/null
+++ b/src/error.rs
@@ -0,0 +1,21 @@
+use derive_more::From;
+
+pub type Result<T> = core::result::Result<T, Error>;
+
+#[derive(Debug, From)]
+pub enum Error {
+ InvalidPath,
+ NotFound(String),
+
+ #[from]
+ Io(std::io::Error),
+
+ #[from]
+ Json(serde_json::Error),
+
+ #[from]
+ Http(reqwest::Error),
+
+ #[from]
+ EnvVar(std::env::VarError),
+}
diff --git a/src/lib.rs b/src/lib.rs
index c0db44a..3e20bde 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -6,6 +6,7 @@ mod manager;
mod paths;
mod symlink;
mod tui;
+mod error;
pub use crate::appimage::*;
pub use crate::args::*;
@@ -15,3 +16,4 @@ pub use crate::manager::*;
pub use crate::paths::*;
pub use crate::symlink::*;
pub use crate::tui::*;
+pub use crate::error::*;