mirror of
https://github.com/cobalt-org/cobalt.rs
synced 2024-11-14 16:07:22 +00:00
fix(data-files): Provide information which file caused an error
This commit is contained in:
parent
86bb35fb57
commit
6b8e701833
1 changed files with 6 additions and 3 deletions
|
@ -165,11 +165,14 @@ fn insert_data_dir(data: &mut liquid::Object, data_root: &path::Path) -> Result<
|
|||
.file_stem()
|
||||
.expect("Files will always return with a stem");
|
||||
let file_stem = String::from(file_stem.to_str().unwrap());
|
||||
let data_fragment = load_data(&full_path)
|
||||
.chain_err(|| format!("Loading data from {:?} failed", full_path))?;
|
||||
|
||||
let data_fragment = load_data(&full_path)?;
|
||||
|
||||
deep_insert(data, rel_path, file_stem, data_fragment)?;
|
||||
deep_insert(data, rel_path, file_stem, data_fragment)
|
||||
.chain_err(|| format!("Merging data into {:?} failed", rel_path))?;
|
||||
}
|
||||
|
||||
trace!("Done loading data directory.");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue