summaryrefslogtreecommitdiffstats
path: root/src/api/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/error.rs')
-rw-r--r--src/api/error.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/api/error.rs b/src/api/error.rs
index 4088b9b..f5d4291 100644
--- a/src/api/error.rs
+++ b/src/api/error.rs
@@ -15,6 +15,9 @@ pub enum Error {
#[error("Invalid email: {0}")]
EmailInvalid(#[from] email_address::Error),
+ #[error("Failed to reach authentication server: {0}")]
+ AuthRequest(#[from] axum::http::Error),
+
#[error("Authentication error: {0}")]
Auth(#[from] crate::auth::error::Error),
}
@@ -28,7 +31,7 @@ impl axum::response::IntoResponse for Error {
Self::EmailExists => StatusCode::CONFLICT,
Self::EmailInvalid(_) => StatusCode::UNPROCESSABLE_ENTITY,
Self::InvalidToken => StatusCode::UNAUTHORIZED,
- Self::Sqlx(_) => StatusCode::INTERNAL_SERVER_ERROR,
+ Self::AuthRequest(_) | Self::Sqlx(_) => StatusCode::INTERNAL_SERVER_ERROR,
Self::Auth(err) => return err.into_response(),
};