diff --git a/tonic/src/client/grpc.rs b/tonic/src/client/grpc.rs index 6a42b4022..2e3c2de85 100644 --- a/tonic/src/client/grpc.rs +++ b/tonic/src/client/grpc.rs @@ -103,7 +103,11 @@ impl Grpc { let message = body .try_next() - .await? + .await + .map_err(|mut status| { + status.metadata_mut().merge(parts.clone()); + status + })? .ok_or_else(|| Status::new(Code::Internal, "Missing response message."))?; if let Some(trailers) = body.trailers().await? {