From fb5241d2f1ad12877814d0b29ab439f7fe09e552 Mon Sep 17 00:00:00 2001 From: Cyprian <46838495+cpprian@users.noreply.github.com> Date: Sun, 4 Aug 2024 17:10:54 +0200 Subject: [PATCH] Fixes in the enrollment process (#69) * enhance logs when token expired * condence log message for token expiration error * send core error message --- src/handlers/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs index 2d1c62f..b4c70b9 100644 --- a/src/handlers/mod.rs +++ b/src/handlers/mod.rs @@ -49,7 +49,7 @@ async fn get_core_response(rx: Receiver) -> Result { if let Ok(core_response) = timeout(Duration::from_secs(CORE_RESPONSE_TIMEOUT), rx).await { debug!("Got gRPC response from Defguard core: {core_response:?}"); if let Ok(Payload::CoreError(core_error)) = core_response { - return Err(core_error.into()); + return Err(ApiError::BadRequest(format!("{}", core_error.message))); }; core_response .map_err(|err| ApiError::Unexpected(format!("Failed to receive core response: {err}")))