From df3067a8f81ca9c4417e97e8668d8bc53add06ed Mon Sep 17 00:00:00 2001 From: Reactor Scram Date: Wed, 4 Sep 2024 21:43:25 -0500 Subject: [PATCH] chore(rust/windows): more detailed error log for `wintun::Adapter::create` (#6596) Without this we don't log the `std::io::ErrorKind`, which is useful to know. Refs #6547 --- rust/bin-shared/src/tun_device_manager/windows.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rust/bin-shared/src/tun_device_manager/windows.rs b/rust/bin-shared/src/tun_device_manager/windows.rs index 223dd4815..42327dc5f 100644 --- a/rust/bin-shared/src/tun_device_manager/windows.rs +++ b/rust/bin-shared/src/tun_device_manager/windows.rs @@ -226,7 +226,13 @@ impl Tun { let uuid = uuid::Uuid::from_str(TUNNEL_UUID) .expect("static UUID should always parse correctly") .as_u128(); - let adapter = &Adapter::create(&wintun, TUNNEL_NAME, TUNNEL_NAME, Some(uuid))?; + let adapter = match Adapter::create(&wintun, TUNNEL_NAME, TUNNEL_NAME, Some(uuid)) { + Ok(x) => x, + Err(error) => { + tracing::error!(?error, "Failed in `Adapter::create`"); + return Err(error)?; + } + }; let iface_idx = adapter.get_adapter_index()?; set_iface_config(adapter.get_luid(), mtu)?;