1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-20 12:02:22 +03:00

Simplify route error handling

This commit is contained in:
Quentin Gliech
2022-11-24 15:08:34 +01:00
parent 28bfce7e45
commit fcb6190a56
4 changed files with 45 additions and 128 deletions

View File

@@ -55,6 +55,19 @@ mod oauth2;
mod upstream_oauth2;
mod views;
/// Implement `From<E>` for `RouteError`, for "internal server error" kind of
/// errors.
#[macro_export]
macro_rules! impl_from_error_for_route {
($error:ty) => {
impl From<$error> for self::RouteError {
fn from(e: $error) -> Self {
Self::InternalError(Box::new(e))
}
}
};
}
pub use mas_axum_utils::http_client_factory::HttpClientFactory;
pub use self::{app_state::AppState, compat::MatrixHomeserver, graphql::schema as graphql_schema};