1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-24 00:21:08 +01:00

From Boxed ResponseError impl added (#3388)

* From Boxed ResponseError impl added

* docs: update changelog

---------

Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
Abedi 2024-06-07 17:25:29 +03:30 committed by GitHub
parent ebd8bb266d
commit 85655f731d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -2,6 +2,10 @@
## Unreleased ## Unreleased
### Added
- Implement `From<Box<dyn ResponseError>>` for `Error`.
## 4.6.0 ## 4.6.0
### Added ### Added

View File

@ -60,6 +60,12 @@ impl<T: ResponseError + 'static> From<T> for Error {
} }
} }
impl From<Box<dyn ResponseError>> for Error {
fn from(value: Box<dyn ResponseError>) -> Self {
Error { cause: value }
}
}
impl From<Error> for Response<BoxBody> { impl From<Error> for Response<BoxBody> {
fn from(err: Error) -> Response<BoxBody> { fn from(err: Error) -> Response<BoxBody> {
err.error_response().into() err.error_response().into()