From Boxed ResponseError impl added

This commit is contained in:
AzerothA 2024-06-06 12:36:22 +03:30
parent dd84bcb609
commit 3d583f3d85
1 changed files with 6 additions and 0 deletions

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()