Formatted file
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user