Skip to content

Commit

Permalink
fix(data-files): Provide information which file caused an error
Browse files Browse the repository at this point in the history
  • Loading branch information
gnunicorn committed Oct 30, 2017
1 parent 86bb35f commit 6b8e701
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/site.rs
Expand Up @@ -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(())
}

0 comments on commit 6b8e701

Please sign in to comment.