From c197d506260a0732c69d2475420c4704dd88ca61 Mon Sep 17 00:00:00 2001 From: Dominik George <dominik.george@teckids.org> Date: Tue, 11 May 2021 20:32:17 +0200 Subject: [PATCH] [NSS] Log JSON error --- src/nss.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/nss.rs b/src/nss.rs index 9588e03..986cf0f 100644 --- a/src/nss.rs +++ b/src/nss.rs @@ -95,8 +95,8 @@ impl PasswdHooks for OidcPasswd { ctc = ct.clone(); &ctc }, - Err(_) => { - error!("Failed to get access token with client credentials"); + Err(e) => { + error!("Failed to get access token with client credentials: {}", e); return Response::Unavail; } } @@ -105,8 +105,8 @@ impl PasswdHooks for OidcPasswd { let data: Vec<PasswdHelper> = match get_data_jq(&conf, "nss", "passwd.list", "".to_string(), &token, true) { Ok(d) => d, - Err(_) => { - error!("Could not load JSON data for passwd"); + Err(e) => { + error!("Could not load JSON data for passwd: {}", e); return Response::Unavail; } }; @@ -129,8 +129,8 @@ impl PasswdHooks for OidcPasswd { ctc = ct.clone(); &ctc }, - Err(_) => { - error!("Failed to get access token with client credentials"); + Err(e) => { + error!("Failed to get access token with client credentials: {}", e); return Response::Unavail; } } @@ -139,8 +139,8 @@ impl PasswdHooks for OidcPasswd { let data: Passwd = match get_data_jq(&conf, "nss", "passwd.by_uid", uid.to_string(), &token, false).map(|PasswdHelper(p)| p) { Ok(d) => d, - Err(_) => { - error!("Could not load JSON data for passwd"); + Err(e) => { + error!("Could not load JSON data for passwd: {}", e); return Response::NotFound; } }; @@ -163,8 +163,8 @@ impl PasswdHooks for OidcPasswd { ctc = ct.clone(); &ctc }, - Err(_) => { - error!("Failed to get access token with client credentials"); + Err(e) => { + error!("Failed to get access token with client credentials: {}", e); return Response::Unavail; } } @@ -173,8 +173,8 @@ impl PasswdHooks for OidcPasswd { let data: Passwd = match get_data_jq(&conf, "nss", "passwd.by_name", name, &token, false).map(|PasswdHelper(p)| p) { Ok(d) => d, - Err(_) => { - error!("Could not load JSON data for passwd"); + Err(e) => { + error!("Could not load JSON data for passwd: {}", e); return Response::NotFound; } }; -- GitLab