From 1fba3f429e71e6141f3c71945b6c07bb35e3e8e5 Mon Sep 17 00:00:00 2001 From: Alex Vig Date: Thu, 28 Jun 2018 18:35:03 -0400 Subject: [PATCH] Updated error handling Now can identify which profile is malformed. --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index aea24f9..86e6dcf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -115,7 +115,7 @@ fn load_profs(fnames: Vec, dpath: &std::path::PathBuf) -> HashMap Vec { let file = fs::File::open(fpath).expect(&format!("could not open profile: {}", fname)); - let json: Value = serde_json::from_reader(file).expect("error reading json file"); + let json: Value = serde_json::from_reader(file).expect(&format!("error reading profile {}", &fname)); let parents: Vec = match &json["inherits"] { &Value::Null => {