Skip to content

Commit

Permalink
Display the cause for a ParseError in AMQPCodec
Browse files Browse the repository at this point in the history
  • Loading branch information
kureuil committed Nov 17, 2018
1 parent f1d327f commit 3148e07
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions futures/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use error::Error;
pub enum CodecError {
#[fail(display = "IO Error: {}", _0)]
IoError(io::Error),
#[fail(display = "Couldn't parse incoming frame")]
ParseError,
#[fail(display = "Couldn't parse incoming frame: {}", _0)]
ParseError(String),
#[fail(display = "Couldn't generate outcoming frame: {:?}", _0)]
GenerationError(GenError),
}
Expand Down Expand Up @@ -56,7 +56,7 @@ impl Decoder for AMQPCodec {
if e.is_incomplete() {
return Ok(None);
} else {
return Err(CodecError::ParseError);
return Err(CodecError::ParseError(format!("{:?}", e)));
}
},
Ok((i, frame)) => {
Expand Down

0 comments on commit 3148e07

Please sign in to comment.