From b749da47663580cc22d3dd016b7046f76b6fa1e5 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Mon, 17 Mar 2025 22:30:51 +1100 Subject: [PATCH] chore(gui-client): improve context when `resolvectl` fails (#8462) Took me a while to figure out what the "File not found" error was pointing to. Adding some context should help. --- rust/headless-client/src/dns_control/linux.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rust/headless-client/src/dns_control/linux.rs b/rust/headless-client/src/dns_control/linux.rs index 390d6ab31..765fe4cb6 100644 --- a/rust/headless-client/src/dns_control/linux.rs +++ b/rust/headless-client/src/dns_control/linux.rs @@ -48,7 +48,10 @@ impl DnsController { // Flushing is only implemented for systemd-resolved if matches!(self.dns_control_method, DnsControlMethod::SystemdResolved) { tracing::debug!("Flushing systemd-resolved DNS cache..."); - Command::new("resolvectl").arg("flush-caches").status()?; + Command::new("resolvectl") + .arg("flush-caches") + .status() + .context("Failed to run `resolvectl flush-caches`")?; tracing::debug!("Flushed DNS."); } Ok(())