diff options
author | Toby Vincent <tobyv@tobyvin.dev> | 2024-04-16 14:51:47 -0500 |
---|---|---|
committer | Toby Vincent <tobyv@tobyvin.dev> | 2024-04-16 14:51:47 -0500 |
commit | 22c72bba9819475509e901ffba4e38ed30d13dd3 (patch) | |
tree | 7c1f3ae9be9f1b2358a75872cbd1d8165d7c2163 /src | |
parent | 7b67a5f28d327c665be64a0091b0a46fedf3e99a (diff) |
fix: remove unused error types
Diffstat (limited to 'src')
-rw-r--r-- | src/api/error.rs | 5 | ||||
-rw-r--r-- | src/auth/error.rs | 3 |
2 files changed, 1 insertions, 7 deletions
diff --git a/src/api/error.rs b/src/api/error.rs index 9048c20..3733d50 100644 --- a/src/api/error.rs +++ b/src/api/error.rs @@ -27,9 +27,6 @@ pub enum Error { #[error("Failed to reach authentication server: {0}")] AuthRequest(#[from] axum::http::Error), - #[error("Not authorization values found")] - Unauthorized, - #[error("Authentication error: {0}")] Auth(#[from] crate::auth::error::Error), } @@ -52,7 +49,7 @@ impl axum::response::IntoResponse for Error { let status = match self { Self::RouteNotFound(_) | Self::UserNotFound => StatusCode::NOT_FOUND, Self::EmailExists => StatusCode::CONFLICT, - Self::InvalidToken | Self::Unauthorized => StatusCode::UNAUTHORIZED, + Self::InvalidToken => StatusCode::UNAUTHORIZED, Self::HeaderNotFound(ref h) if h == AUTHORIZATION => StatusCode::UNAUTHORIZED, Self::HeaderNotFound(_) => StatusCode::BAD_REQUEST, Self::EmailInvalid(_) | Self::Header(_) => StatusCode::UNPROCESSABLE_ENTITY, diff --git a/src/auth/error.rs b/src/auth/error.rs index 8b1bb4c..17cf6d1 100644 --- a/src/auth/error.rs +++ b/src/auth/error.rs @@ -33,9 +33,6 @@ pub enum Error { #[error("Authorization token not found")] JwtNotFound, - #[error("Token found was invalid type")] - InvalidTokenType, - #[error("The user belonging to this token no longer exists")] UserNotFound, } |