diff --git a/src/book/book.rs b/src/book/book.rs index 994238bd..4331a970 100644 --- a/src/book/book.rs +++ b/src/book/book.rs @@ -14,11 +14,12 @@ pub fn load_book>(src_dir: P, cfg: &BuildConfig) -> Result let summary_md = src_dir.join("SUMMARY.md"); let mut summary_content = String::new(); - File::open(summary_md) - .with_context(|| "Couldn't open SUMMARY.md")? + File::open(&summary_md) + .with_context(|| format!("Couldn't open SUMMARY.md in {:?} directory", src_dir))? .read_to_string(&mut summary_content)?; - let summary = parse_summary(&summary_content).with_context(|| "Summary parsing failed")?; + let summary = parse_summary(&summary_content) + .with_context(|| format!("Summary parsing failed for file={:?}", summary_md))?; if cfg.create_missing { create_missing(&src_dir, &summary).with_context(|| "Unable to create missing chapters")?;