mirror of
https://github.com/actix/actix-web.git
synced 2024-11-26 03:21:08 +00:00
fix http error debug impl
This commit is contained in:
parent
11bfa84926
commit
218e34ee17
3 changed files with 5 additions and 10 deletions
|
@ -108,8 +108,10 @@ pub(crate) enum Kind {
|
||||||
|
|
||||||
impl fmt::Debug for Error {
|
impl fmt::Debug for Error {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
// TODO: more detail
|
f.debug_struct("actix_http::Error")
|
||||||
f.write_str("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 {
|
impl StdError for DispatchError {
|
||||||
fn source(&self) -> Option<&(dyn StdError + 'static)> {
|
fn source(&self) -> Option<&(dyn StdError + 'static)> {
|
||||||
match self {
|
match self {
|
||||||
// TODO: error source extraction?
|
|
||||||
DispatchError::Service(_res) => None,
|
DispatchError::Service(_res) => None,
|
||||||
DispatchError::Body(err) => Some(&**err),
|
DispatchError::Body(err) => Some(&**err),
|
||||||
DispatchError::Io(err) => Some(err),
|
DispatchError::Io(err) => Some(err),
|
||||||
|
|
|
@ -323,12 +323,6 @@ impl From<Error> for HttpResponse {
|
||||||
impl<B> From<HttpResponse<B>> for Response<B> {
|
impl<B> From<HttpResponse<B>> for Response<B> {
|
||||||
fn from(res: HttpResponse<B>) -> Self {
|
fn from(res: HttpResponse<B>) -> Self {
|
||||||
// this impl will always be called as part of dispatcher
|
// 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
|
res.res
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,7 +232,7 @@ where
|
||||||
None => {
|
None => {
|
||||||
let (io, proto) = connector.call(req).await?;
|
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);
|
assert!(proto != Protocol::Http3);
|
||||||
|
|
||||||
if proto == Protocol::Http1 {
|
if proto == Protocol::Http1 {
|
||||||
|
|
Loading…
Reference in a new issue