You've already forked authentication-service
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user