From 78aa1f2bf145b26d705c43114b22245ec0cc7952 Mon Sep 17 00:00:00 2001 From: Ron Waldon-Howe Date: Sat, 30 Nov 2024 12:20:05 +1100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=8A=20Make=20errors=20and=20warnings?= =?UTF-8?q?=20a=20little=20bit=20more=20descriptive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See: https://github.com/dbus2/busd/pull/159#discussion_r1863490751 --- src/config/xml.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/config/xml.rs b/src/config/xml.rs index 89e7fd6..2cda981 100644 --- a/src/config/xml.rs +++ b/src/config/xml.rs @@ -63,7 +63,7 @@ impl Document { // we treat `` as though it has `ignore_missing="yes"` Err(err) => { warn!( - "should canonicalize directory path '{}': {:?}", + "cannot resolve '{}' to an absolute path: {}", &dir_path.display(), err ); @@ -86,7 +86,11 @@ impl Document { } // we treat `` as though it has `ignore_missing="yes"` Err(err) => { - warn!("should read directory '{}': {:?}", &dir_path.display(), err); + warn!( + "cannot read '{}': {}", + &dir_path.display(), + err + ); continue; } } @@ -128,7 +132,7 @@ impl Document { Ok(ok) => ok, Err(err) => { let msg = format!( - "should canonicalize file path '{}': {:?}", + "cannot resolve '{}' to an absolute path: {}", &file_path.display(), err ); @@ -172,7 +176,7 @@ impl Document { .ok_or_else(|| Error::msg("`` path should contain a file name"))? .to_path_buf()), None => { - warn!("ad-hoc document with unknown file path, using current working directory"); + warn!("cannot determine file path for this XML document, using current working directory"); current_dir().map_err(Error::msg) } } @@ -333,11 +337,5 @@ fn resolve_include_path(base_path: impl AsRef, include_path: impl AsRef