Skip to content

Commit

Permalink
fix(codec): improve error message for invalid compression flag (#663)
Browse files Browse the repository at this point in the history
* fix(codec): improve error message for invalid compression flag

Fixes #492

* Update tonic/src/codec/decode.rs
  • Loading branch information
davidpdrsn authored May 28, 2021
1 parent e5e3118 commit 9cc14b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tonic/src/codec/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ impl<T> Streaming<T> {
trace!("unexpected compression flag");
let message = if let Direction::Response(status) = self.direction {
format!(
"Unexpected compression flag: {}, while receiving response with status: {}",
"protocol error: received message with invalid compression flag: {} (valid flags are 0 and 1) while receiving response with status: {}",
f, status
)
} else {
format!("Unexpected compression flag: {}, while sending request", f)
format!("protocol error: received message with invalid compression flag: {} (valid flags are 0 and 1), while sending request", f)
};
return Err(Status::new(Code::Internal, message));
}
Expand Down

0 comments on commit 9cc14b7

Please sign in to comment.