Formatted file
This commit is contained in:
@@ -6,7 +6,7 @@ use reqwest::StatusCode;
|
|||||||
pub enum AppError {
|
pub enum AppError {
|
||||||
InternalError(String),
|
InternalError(String),
|
||||||
OpenIdError(String),
|
OpenIdError(String),
|
||||||
Unauthorised
|
Unauthorised,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl IntoResponse for AppError {
|
impl IntoResponse for AppError {
|
||||||
@@ -14,7 +14,10 @@ impl IntoResponse for AppError {
|
|||||||
let (status, message) = match self {
|
let (status, message) = match self {
|
||||||
AppError::InternalError(msg) => (StatusCode::INTERNAL_SERVER_ERROR, msg),
|
AppError::InternalError(msg) => (StatusCode::INTERNAL_SERVER_ERROR, msg),
|
||||||
AppError::OpenIdError(msg) => (StatusCode::UNPROCESSABLE_ENTITY, 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()
|
(status, message).into_response()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user