diff --git a/rust/gui-client/src-common/src/deep_link/windows.rs b/rust/gui-client/src-common/src/deep_link/windows.rs index fb2b16741..b1c48c9b9 100644 --- a/rust/gui-client/src-common/src/deep_link/windows.rs +++ b/rust/gui-client/src-common/src/deep_link/windows.rs @@ -4,6 +4,7 @@ use super::FZ_SCHEME; use anyhow::{Context, Result}; use firezone_bin_shared::BUNDLE_ID; +use firezone_logging::std_dyn_err; use secrecy::Secret; use std::{ io, @@ -68,23 +69,24 @@ async fn bind_to_pipe(pipe_path: &str) -> Result return Ok(server), - Err(super::Error::CantListen) => { - tracing::warn!("`create_pipe_server` failed, sleeping... (loop {i})"); + Err(e) => { + tracing::warn!( + error = std_dyn_err(&e), + "`create_pipe_server` failed, sleeping... (attempt {i}/{NUM_ITERS})" + ); tokio::time::sleep(Duration::from_secs(1)).await; } - Err(error) => Err(error)?, } } Err(super::Error::CantListen) } -fn create_pipe_server(pipe_path: &str) -> Result { +fn create_pipe_server(pipe_path: &str) -> io::Result { let mut server_options = named_pipe::ServerOptions::new(); server_options.first_pipe_instance(true); - let server = server_options - .create(pipe_path) - .map_err(|_| super::Error::CantListen)?; + let server = server_options.create(pipe_path)?; + Ok(server) }