Skip to content

Commit

Permalink
fix(server): Use Status::into_http api in recover error service (#2099)
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto authored Dec 14, 2024
1 parent 4ed340d commit 36bc21c
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 36bc21c

Please sign in to comment.