Formatted file

This commit is contained in:
2026-08-29 18:05:36 +02:00
parent 27b954a5ec
commit 2a029709b8

View File

@@ -6,7 +6,7 @@ use reqwest::StatusCode;
pub enum AppError {
InternalError(String),
OpenIdError(String),
Unauthorised
Unauthorised,
}
impl IntoResponse for AppError {
@@ -14,7 +14,10 @@ impl IntoResponse for AppError {
let (status, message) = match self {
AppError::InternalError(msg) => (StatusCode::INTERNAL_SERVER_ERROR, msg),
AppError::OpenIdError(msg) => (StatusCode::UNPROCESSABLE_ENTITY, msg),
AppError::Unauthorised => (StatusCode::UNAUTHORIZED, "Unauthorised (did you login?)".into())
AppError::Unauthorised => (
StatusCode::UNAUTHORIZED,
"Unauthorised (did you login?)".into(),
),
};
(status, message).into_response()
}