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.
This commit is contained in:
Reactor Scram
2024-09-03 14:59:03 -05:00
committed by GitHub
parent 09f4b6e790
commit afb405ce9f

View File

@@ -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