1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-25 11:01:14 +00: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
### Added
- Implement `From<Box<dyn ResponseError>>` for `Error`.
## 4.6.0
### 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> {
fn from(err: Error) -> Response<BoxBody> {
err.error_response().into()