From 3bc7cf8ed36016ca3da9438a98f4fe8b8e6f9e61 Mon Sep 17 00:00:00 2001 From: FxQnLr Date: Thu, 15 Feb 2024 17:17:30 +0100 Subject: Closes #10 & #12. Added `thiserror` crate and changed to `IntoSocketAddr` for easier usage and error handling --- src/auth.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/auth.rs') diff --git a/src/auth.rs b/src/auth.rs index feca652..eb4d1bf 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -9,7 +9,7 @@ pub fn auth(config: &Config, secret: Option<&HeaderValue>) -> Result) -> Result (StatusCode::UNAUTHORIZED, "Wrong credentials"), Self::MissingSecret => (StatusCode::BAD_REQUEST, "Missing credentials"), - Self::HeaderToStr(err) => { - error!("server error: {}", err.to_string()); + Self::HeaderToStr { source } => { + error!("auth: {}", source); (StatusCode::INTERNAL_SERVER_ERROR, "Server Error") }, } -- cgit v1.2.3