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.
This commit is contained in:
Thomas Eizinger
2025-03-17 22:30:51 +11:00
committed by GitHub
parent 022fb9fed9
commit b749da4766

View File

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