[pve-devel] [PATCH installer 4/6] common: setup: include path in error message if file could not be read
Christoph Heiss
c.heiss at proxmox.com
Mon Dec 9 13:45:57 CET 2024
Makes it a bit easier to figure out what went wrong in the error case.
Signed-off-by: Christoph Heiss <c.heiss at proxmox.com>
---
proxmox-installer-common/src/setup.rs | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/proxmox-installer-common/src/setup.rs b/proxmox-installer-common/src/setup.rs
index c3004bc..0ef47d2 100644
--- a/proxmox-installer-common/src/setup.rs
+++ b/proxmox-installer-common/src/setup.rs
@@ -187,22 +187,28 @@ pub fn load_installer_setup_files(
let mut path = runtime_dir.as_ref().to_path_buf();
path.push("iso-info.json");
- read_json(&path).map_err(|err| format!("Failed to retrieve setup info: {err}"))?
+ read_json(&path)
+ .map_err(|err| format!("Failed to retrieve setup info: {}: {err}", path.display()))?
};
let locale_info = {
let mut path = installer_info.locations.lib.clone();
path.push("locale-info.json");
- read_json(&path).map_err(|err| format!("Failed to retrieve locale info: {err}"))?
+ read_json(&path)
+ .map_err(|err| format!("Failed to retrieve locale info: {}: {err}", path.display()))?
};
let mut runtime_info: RuntimeInfo = {
let mut path = runtime_dir.as_ref().to_path_buf();
path.push("run-env-info.json");
- read_json(&path)
- .map_err(|err| format!("Failed to retrieve runtime environment info: {err}"))?
+ read_json(&path).map_err(|err| {
+ format!(
+ "Failed to retrieve runtime environment info: {}: {err}",
+ path.display()
+ )
+ })?
};
runtime_info.disks.sort();
--
2.47.0
More information about the pve-devel
mailing list