1
Fork 0

Add Error impls to a few key error types

This commit is contained in:
Aaron Turon 2014-10-03 14:24:49 -07:00
parent 6815c2e8e8
commit 7c152f870d
5 changed files with 66 additions and 0 deletions

View file

@ -313,6 +313,11 @@ fn io_error_to_error(io: io::IoError) -> ParserError {
IoError(io.kind, io.desc)
}
impl std::error::Error for DecoderError {
fn description(&self) -> &str { "decoder error" }
fn detail(&self) -> Option<std::string::String> { Some(self.to_string()) }
}
pub type EncodeResult = io::IoResult<()>;
pub type DecodeResult<T> = Result<T, DecoderError>;