From 85655f731d9d23f9b472b0a2ace817031c8c5e8d Mon Sep 17 00:00:00 2001 From: Abedi Date: Fri, 7 Jun 2024 17:25:29 +0330 Subject: [PATCH] From Boxed ResponseError impl added (#3388) * From Boxed ResponseError impl added * docs: update changelog --------- Co-authored-by: Rob Ede --- actix-web/CHANGES.md | 4 ++++ actix-web/src/error/error.rs | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/actix-web/CHANGES.md b/actix-web/CHANGES.md index 993c7c59..e0390563 100644 --- a/actix-web/CHANGES.md +++ b/actix-web/CHANGES.md @@ -2,6 +2,10 @@ ## Unreleased +### Added + +- Implement `From>` for `Error`. + ## 4.6.0 ### Added diff --git a/actix-web/src/error/error.rs b/actix-web/src/error/error.rs index 3a5a128f..670a58a0 100644 --- a/actix-web/src/error/error.rs +++ b/actix-web/src/error/error.rs @@ -60,6 +60,12 @@ impl From for Error { } } +impl From> for Error { + fn from(value: Box) -> Self { + Error { cause: value } + } +} + impl From for Response { fn from(err: Error) -> Response { err.error_response().into()