feat(h2): always include original h2 error on broken pipe

This commit is contained in:
Anthony Ramine
2021-10-04 11:46:10 +02:00
committed by Sean McArthur
parent ecd5dc1034
commit 6169db250c

View File

@@ -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)),
})
}