Skip to content

Commit

Permalink
feat(codec): Improve compression flag log (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
snawaz authored Jul 6, 2020
1 parent 9c954e0 commit d68dd36
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tonic/src/codec/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,15 @@ impl<T> Streaming<T> {
}
f => {
trace!("unexpected compression flag");
return Err(Status::new(
Code::Internal,
format!("Unexpected compression flag: {}", f),
));
let message = if let Direction::Response(status) = self.direction {
format!(
"Unexpected compression flag: {}, while receiving response with status: {}",
f, status
)
} else {
format!("Unexpected compression flag: {}, while sending request", f)
};
return Err(Status::new(Code::Internal, message));
}
};
let len = self.buf.get_u32() as usize;
Expand Down

0 comments on commit d68dd36

Please sign in to comment.