mirror of
https://github.com/actix/actix-web.git
synced 2024-12-21 23:56:35 +00:00
set response error body
This commit is contained in:
parent
7d6085ddbd
commit
954fe21751
1 changed files with 2 additions and 1 deletions
|
@ -54,7 +54,8 @@ impl Response<Body> {
|
|||
/// Constructs an error response
|
||||
#[inline]
|
||||
pub fn from_error(error: Error) -> Response {
|
||||
let mut resp = error.as_response_error().error_response();
|
||||
let resp = error.as_response_error().error_response();
|
||||
let mut resp = resp.set_body(Body::from(format!("{}", error)));
|
||||
resp.error = Some(error);
|
||||
resp
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue