Fine tuned authorization header errors.
This commit is contained in:
+4
-4
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user