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

templates: fix the _ function not working in macros

This commit is contained in:
Quentin Gliech
2023-10-05 11:26:53 +02:00
parent ebdb8eb30e
commit 6ff549f5df
5 changed files with 73 additions and 25 deletions

View File

@@ -15,8 +15,9 @@
use axum::{
http::StatusCode,
response::{IntoResponse, Response},
Extension,
Extension, TypedHeader,
};
use headers::ContentType;
use mas_templates::ErrorContext;
use crate::sentry::SentryEventID;
@@ -60,10 +61,11 @@ impl<E: std::fmt::Debug + std::fmt::Display> From<E> for FancyError {
impl IntoResponse for FancyError {
fn into_response(self) -> Response {
let error = format!("{:?}", self.context);
let error = format!("{}", self.context);
let event_id = sentry::capture_message(&error, sentry::Level::Error);
(
StatusCode::INTERNAL_SERVER_ERROR,
TypedHeader(ContentType::text()),
SentryEventID::from(event_id),
Extension(self.context),
error,