print the actual json error if the config is broken
This commit is contained in:
parent
510b023e4e
commit
9c51da97a8
2 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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<String, u8> = serde_json::from_reader(fs::File::open("id_keys.json")
|
||||
.map_err(|_| Errorfr::IDMapJsonMissing)?)
|
||||
.map_err(|_| Errorfr::IDMapJsonCorrupt)?;
|
||||
|
|
Loading…
Reference in a new issue