diff --git a/tonic/src/codec/decode.rs b/tonic/src/codec/decode.rs index 73f3427af..dc68d7c52 100644 --- a/tonic/src/codec/decode.rs +++ b/tonic/src/codec/decode.rs @@ -173,11 +173,11 @@ impl Streaming { 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)); }