From 6169db250c932dd012d391389826cd34833077b4 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Mon, 4 Oct 2021 11:46:10 +0200 Subject: [PATCH] feat(h2): always include original h2 error on broken pipe --- src/proto/h2/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/proto/h2/mod.rs b/src/proto/h2/mod.rs index 7ad4b48a31..5857c919d1 100644 --- a/src/proto/h2/mod.rs +++ b/src/proto/h2/mod.rs @@ -316,7 +316,9 @@ where Some(Err(e)) => { return Poll::Ready(match e.reason() { Some(Reason::NO_ERROR) | Some(Reason::CANCEL) => Ok(()), - Some(Reason::STREAM_CLOSED) => Err(io::ErrorKind::BrokenPipe.into()), + Some(Reason::STREAM_CLOSED) => { + Err(io::Error::new(io::ErrorKind::BrokenPipe, e)) + } _ => Err(h2_to_io_error(e)), }) }