Skip to content

Commit

Permalink
fix(server): Use Status::into_http api in recover error service
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto committed Dec 14, 2024
1 parent 4ed340d commit a859c84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tonic/src/transport/server/service/recover_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ where
}
Err(err) => match Status::try_from_error(err) {
Ok(status) => {
let mut res = Response::new(MaybeEmptyBody::empty());
status.add_header(res.headers_mut()).unwrap();
let (parts, ()) = status.into_http::<()>().into_parts();
let res = Response::from_parts(parts, MaybeEmptyBody::empty());
Poll::Ready(Ok(res))
}
Err(err) => Poll::Ready(Err(err)),
Expand Down

0 comments on commit a859c84

Please sign in to comment.