From afb405ce9f1f2aa93b80365f91cc1829e9a0662c Mon Sep 17 00:00:00 2001 From: Reactor Scram Date: Tue, 3 Sep 2024 14:59:03 -0500 Subject: [PATCH] chore(rust/gui-client): log connlib connection errors (#6574) Old behavior: Connection errors are sent to the GUI but the IPC service forgets about them. New behavior: Clone the error and log it on both sides. Found while debugging a customer issue. This would have made the logs easier to read. --- rust/headless-client/src/ipc_service.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rust/headless-client/src/ipc_service.rs b/rust/headless-client/src/ipc_service.rs index a1d033963..cab0d832f 100644 --- a/rust/headless-client/src/ipc_service.rs +++ b/rust/headless-client/src/ipc_service.rs @@ -426,8 +426,12 @@ impl<'a> Handler<'a> { .context("Error while sending IPC message")? } ClientMsg::Connect { api_url, token } => { + // Warning: Connection errors don't bubble to callers of `handle_ipc_msg`. let token = secrecy::SecretString::from(token); let result = self.connect_to_firezone(&api_url, token); + if let Err(error) = &result { + tracing::error!(?error, "Failed to connect connlib session"); + } self.ipc_tx .send(&ServerMsg::ConnectResult(result)) .await