From a1b13288ab82b6c82b0253f9bed53f90b6c5238f Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Wed, 24 Jul 2024 15:40:26 +0200 Subject: [PATCH] axum-utils: make the ErrorWrapper implement std::error::Error --- crates/axum-utils/src/error_wrapper.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/crates/axum-utils/src/error_wrapper.rs b/crates/axum-utils/src/error_wrapper.rs index 379325e5..e30f738d 100644 --- a/crates/axum-utils/src/error_wrapper.rs +++ b/crates/axum-utils/src/error_wrapper.rs @@ -16,13 +16,9 @@ use axum::response::{IntoResponse, Response}; use http::StatusCode; /// A simple wrapper around an error that implements [`IntoResponse`]. -pub struct ErrorWrapper(pub T); - -impl From for ErrorWrapper { - fn from(input: T) -> Self { - Self(input) - } -} +#[derive(Debug, thiserror::Error)] +#[error(transparent)] +pub struct ErrorWrapper(#[from] pub T); impl IntoResponse for ErrorWrapper where