From 2332b7563629fa08ce7842cba4b87db17e47714e Mon Sep 17 00:00:00 2001 From: Zykino Date: Mon, 6 Feb 2023 00:11:51 +0100 Subject: [PATCH] Show config file's path or read error --- src/command.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/command.rs b/src/command.rs index 4724586..a65b872 100644 --- a/src/command.rs +++ b/src/command.rs @@ -174,8 +174,17 @@ impl Updater { for file in packages_folder.read_dir()? { let file = packages_folder.join(file?.path()); // "default.yaml"); let sys = std::fs::read_to_string(&file).unwrap(); - let toto = serde_yaml::from_str(&sys).unwrap(); - updater.systems.push(toto); + let sys = serde_yaml::from_str(&sys).map_err(|err| { + io::Error::new( + io::ErrorKind::Other, + format!( + "Encontered an error while parsing config file {}: {}", + file.display(), + err + ), + ) + })?; + updater.systems.push(sys); } eprintln!("{:#?}", updater);