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:
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user