aboutsummaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-04-05 23:33:42 +0200
committerAlex Auvolat <alex@adnab.me>2020-04-05 23:33:42 +0200
commit7102db1d544bec663a8492b24c455168d0b83f08 (patch)
treecc308cbeefc3f48b55149e85ec737867c24a498e /src/error.rs
downloadgarage-7102db1d544bec663a8492b24c455168d0b83f08.tar.gz
garage-7102db1d544bec663a8492b24c455168d0b83f08.zip
First commit: skeleton for something great
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
new file mode 100644
index 00000000..9929a896
--- /dev/null
+++ b/src/error.rs
@@ -0,0 +1,19 @@
+use err_derive::Error;
+use std::io;
+
+#[derive(Debug, Error)]
+pub enum Error {
+ #[error(display = "IO error")]
+ Io(#[error(source)] io::Error),
+
+ #[error(display = "Hyper error")]
+ Hyper(#[error(source)] hyper::Error),
+
+ #[error(display = "Messagepack encode error")]
+ RMPEncode(#[error(source)] rmp_serde::encode::Error),
+ #[error(display = "Messagepack decode error")]
+ RMPDecode(#[error(source)] rmp_serde::decode::Error),
+
+ #[error(display = "")]
+ Msg(String),
+}