diff --git a/src/errorfr/mod.rs b/src/errorfr/mod.rs index 718018c..81b97eb 100644 --- a/src/errorfr/mod.rs +++ b/src/errorfr/mod.rs @@ -8,7 +8,7 @@ pub enum Errorfr { ItemJsonMissing, /// item config json is corrupt - #[error("Error 2: item config json is corrupt, Reread config.md\n")] + #[error("Error 2: item config json is corrupt, Reread config.md\n{0:?}")] ItemJsonCorrupt(serde_json::Error), /// idmap is missing diff --git a/src/main.rs b/src/main.rs index 72e61fd..558d68f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -54,7 +54,7 @@ fn cook() -> Result<(), Errorfr> { // load configs let json_config: Jsonconfig = serde_json::from_reader(fs::File::open(configpath) .map_err(|_| Errorfr::ItemJsonMissing)?) - .map_err(|_| Errorfr::ItemJsonCorrupt)?; + .map_err(|e| Errorfr::ItemJsonCorrupt(e))?; let idsmap: HashMap = serde_json::from_reader(fs::File::open("id_keys.json") .map_err(|_| Errorfr::IDMapJsonMissing)?) .map_err(|_| Errorfr::IDMapJsonCorrupt)?;