From 218e34ee1763f421b7b1e81a3f83034028e29be5 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Tue, 22 Feb 2022 07:04:23 +0000 Subject: [PATCH] fix http error debug impl --- actix-http/src/error.rs | 7 ++++--- actix-web/src/response/response.rs | 6 ------ awc/src/client/pool.rs | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/actix-http/src/error.rs b/actix-http/src/error.rs index 52b953421..2802d57a4 100644 --- a/actix-http/src/error.rs +++ b/actix-http/src/error.rs @@ -108,8 +108,10 @@ pub(crate) enum Kind { impl fmt::Debug for Error { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - // TODO: more detail - f.write_str("actix_http::Error") + f.debug_struct("actix_http::Error") + .field("kind", &self.inner.kind) + .field("cause", &self.inner.cause) + .finish() } } @@ -386,7 +388,6 @@ pub enum DispatchError { impl StdError for DispatchError { fn source(&self) -> Option<&(dyn StdError + 'static)> { match self { - // TODO: error source extraction? DispatchError::Service(_res) => None, DispatchError::Body(err) => Some(&**err), DispatchError::Io(err) => Some(err), diff --git a/actix-web/src/response/response.rs b/actix-web/src/response/response.rs index 6449c586d..630acc3f2 100644 --- a/actix-web/src/response/response.rs +++ b/actix-web/src/response/response.rs @@ -323,12 +323,6 @@ impl From for HttpResponse { impl From> for Response { fn from(res: HttpResponse) -> Self { // this impl will always be called as part of dispatcher - - // TODO: expose cause somewhere? - // if let Some(err) = res.error { - // return Response::from_error(err); - // } - res.res } } diff --git a/awc/src/client/pool.rs b/awc/src/client/pool.rs index 9d130412b..cc3e4d7c0 100644 --- a/awc/src/client/pool.rs +++ b/awc/src/client/pool.rs @@ -232,7 +232,7 @@ where None => { let (io, proto) = connector.call(req).await?; - // TODO: remove when http3 is added in support. + // NOTE: remove when http3 is added in support. assert!(proto != Protocol::Http3); if proto == Protocol::Http1 {