Add Error impls to a few key error types
This commit is contained in:
parent
6815c2e8e8
commit
7c152f870d
5 changed files with 66 additions and 0 deletions
|
@ -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>;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue