From 9058f191b69ecafc8fdeace227ac113412d03888 Mon Sep 17 00:00:00 2001 From: FxQnLr Date: Sun, 25 Feb 2024 15:15:19 +0100 Subject: Closes #16. Impl auth as extractor --- src/error.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/error.rs') diff --git a/src/error.rs b/src/error.rs index 66a61f4..513b51b 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,8 +1,8 @@ +use ::ipnetwork::IpNetworkError; use axum::http::header::ToStrError; use axum::http::StatusCode; use axum::response::{IntoResponse, Response}; use axum::Json; -use ::ipnetwork::IpNetworkError; use mac_address::MacParseError; use serde_json::json; use std::io; @@ -10,9 +10,6 @@ use tracing::error; #[derive(Debug, thiserror::Error)] pub enum Error { - #[error("generic error")] - Generic, - #[error("db: {source}")] Db { #[from] @@ -54,7 +51,6 @@ impl IntoResponse for Error { fn into_response(self) -> Response { error!("{}", self.to_string()); let (status, error_message) = match self { - Self::Generic => (StatusCode::INTERNAL_SERVER_ERROR, ""), Self::Db { source } => { error!("{source}"); (StatusCode::INTERNAL_SERVER_ERROR, "Server Error") -- cgit v1.2.3