1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 22:49:21 +02:00

Response::from_error take impl Into<Error> (#2214)

This commit is contained in:
fakeshadow
2021-05-26 12:41:48 +08:00
committed by GitHub
parent bb7d33c9d4
commit 3847429d00
2 changed files with 6 additions and 5 deletions

View File

@ -399,7 +399,7 @@ where
// send service call error as response
Poll::Ready(Err(err)) => {
let res = Response::from_error(err.into());
let res = Response::from_error(err);
let (res, body) = res.replace_body(());
self.as_mut().send_error_response(res, body)?;
}
@ -496,7 +496,7 @@ where
// send expect error as response
Poll::Ready(Err(err)) => {
let res = Response::from_error(err.into());
let res = Response::from_error(err);
let (res, body) = res.replace_body(());
self.as_mut().send_error_response(res, body)?;
}
@ -546,7 +546,7 @@ where
// to notify the dispatcher a new state is set and the outer loop
// should be continue.
Poll::Ready(Err(err)) => {
let res = Response::from_error(err.into());
let res = Response::from_error(err);
let (res, body) = res.replace_body(());
return self.send_error_response(res, body);
}
@ -566,7 +566,7 @@ where
Poll::Pending => Ok(()),
// see the comment on ExpectCall state branch's Ready(Err(err)).
Poll::Ready(Err(err)) => {
let res = Response::from_error(err.into());
let res = Response::from_error(err);
let (res, body) = res.replace_body(());
self.send_error_response(res, body)
}