Skip to content
This repository was archived by the owner on Sep 10, 2024. It is now read-only.

Commit a1b1328

Browse files
committed
axum-utils: make the ErrorWrapper implement std::error::Error
1 parent 144de0d commit a1b1328

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

crates/axum-utils/src/error_wrapper.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,9 @@ use axum::response::{IntoResponse, Response};
1616
use http::StatusCode;
1717

1818
/// A simple wrapper around an error that implements [`IntoResponse`].
19-
pub struct ErrorWrapper<T>(pub T);
20-
21-
impl<T> From<T> for ErrorWrapper<T> {
22-
fn from(input: T) -> Self {
23-
Self(input)
24-
}
25-
}
19+
#[derive(Debug, thiserror::Error)]
20+
#[error(transparent)]
21+
pub struct ErrorWrapper<T>(#[from] pub T);
2622

2723
impl<T> IntoResponse for ErrorWrapper<T>
2824
where

0 commit comments

Comments
 (0)