feat(http2): check Error::source() for an HTTP2 error code to send in reset

This commit is contained in:
Sean McArthur
2019-03-25 12:35:47 -07:00
parent d1501a0fd3
commit fc18b680a5
4 changed files with 152 additions and 18 deletions

View File

@@ -211,7 +211,7 @@ where
Err(e) => {
let err = ::Error::new_user_service(e);
warn!("http2 service errored: {}", err);
self.reply.send_reset(Reason::INTERNAL_ERROR);
self.reply.send_reset(err.h2_reason());
return Err(err);
},
};
@@ -232,7 +232,7 @@ where
match self.reply.send_response(res, $eos) {
Ok(tx) => tx,
Err(e) => {
trace!("send response error: {}", e);
debug!("send response error: {}", e);
self.reply.send_reset(Reason::INTERNAL_ERROR);
return Err(::Error::new_h2(e));
}