1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-09 04:22:45 +03:00

axum-utils: make the ErrorWrapper implement std::error::Error

This commit is contained in:
Quentin Gliech
2024-07-24 15:40:26 +02:00
parent 144de0deb2
commit a1b13288ab

View File

@@ -16,13 +16,9 @@ use axum::response::{IntoResponse, Response};
use http::StatusCode;
/// A simple wrapper around an error that implements [`IntoResponse`].
pub struct ErrorWrapper<T>(pub T);
impl<T> From<T> for ErrorWrapper<T> {
fn from(input: T) -> Self {
Self(input)
}
}
#[derive(Debug, thiserror::Error)]
#[error(transparent)]
pub struct ErrorWrapper<T>(#[from] pub T);
impl<T> IntoResponse for ErrorWrapper<T>
where