aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index c817e6c..422ca07 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -41,6 +41,8 @@ pub enum IlcError {
Chrono(ParseError),
BincodeDecode,
BincodeEncode,
+ MsgpackEncode(msgpack::encode::serialize::Error),
+ MsgpackDecode(msgpack::decode::serialize::Error),
Io(io::Error)
}
@@ -58,13 +60,22 @@ impl Error for IlcError {
&Chrono(_) => "error while parsing time strings",
&BincodeDecode => "error while decoding from binary",
&BincodeEncode => "error while encoding to binary",
+ &MsgpackDecode(_) => "error while decoding from msgpack",
+ &MsgpackEncode(_) => "error while encoding to msgpack",
&Io(_) => "error during input/output"
}
}
fn cause(&self) -> Option<&Error> {
+ use IlcError::*;
match self {
- _ => None
+ &Parse(ref _e) => None,
+ &Chrono(ref e) => Some(e),
+ &BincodeDecode => None,
+ &BincodeEncode => None,
+ &MsgpackDecode(ref e) => Some(e),
+ &MsgpackEncode(ref e) => Some(e),
+ &Io(ref e) => Some(e)
}
}
}