1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-07-01 16:55:08 +02:00

Propagate error cause to middlewares (#2280)

This commit is contained in:
Luca Palmieri
2021-06-22 23:22:33 +02:00
committed by GitHub
parent b1148fd735
commit 3b6333e65f
2 changed files with 104 additions and 1 deletions

View File

@ -49,7 +49,10 @@ impl HttpResponse<AnyBody> {
/// Create an error response.
#[inline]
pub fn from_error(error: impl Into<Error>) -> Self {
error.into().as_response_error().error_response()
let error = error.into();
let mut response = error.as_response_error().error_response();
response.error = Some(error);
response
}
}