Fine tuned authorization header errors.

This commit is contained in:
2026-10-09 18:03:54 +02:00
parent 1f6de34e5b
commit dbf6c3d9f5
5 changed files with 129 additions and 29 deletions
+4 -4
View File
@@ -20,7 +20,7 @@ pub enum AppError {
NotFound,
#[error("unauthorized")]
Unauthorized,
Unauthorized(String),
#[error("domain error")]
Domain(#[from] DomainError),
@@ -47,9 +47,9 @@ impl IntoResponse for AppError {
tracing::debug!("not found");
return error_response(StatusCode::NOT_FOUND, "Not found");
}
Self::Unauthorized => {
tracing::debug!("unauthorized");
return error_response(StatusCode::UNAUTHORIZED, "Unauthorized");
Self::Unauthorized(message) => {
tracing::debug!(?message, "unauthorized");
return error_response(StatusCode::UNAUTHORIZED, message);
}
Self::Domain(error) => {
tracing::debug!(%error, "domain error");