Skip to content

Commit 65acb35

Browse files
Merge pull request #513 from Michael-F-Bryan/error-messages
Added better error messages for missing CSS/JS
2 parents a280a30 + 89eff2d commit 65acb35

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/renderer/html_handlebars/hbs_renderer.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ impl HtmlHandlebars {
230230
.chain(html.additional_js.iter());
231231

232232
for custom_file in custom_files {
233-
self.write_custom_file(custom_file, book)?;
233+
self.write_custom_file(&custom_file, book)
234+
.chain_err(|| format!("Copying {} failed", custom_file.display()))?;
234235
}
235236

236237
Ok(())
@@ -312,10 +313,11 @@ impl Renderer for HtmlHandlebars {
312313
&rendered.into_bytes())?;
313314
info!("[*] Creating print.html ✓");
314315

315-
// Copy static files (js, css, images, ...)
316316
debug!("[*] Copy static files");
317-
self.copy_static_files(book, &theme, &html_config)?;
318-
self.copy_additional_css_and_js(book)?;
317+
self.copy_static_files(book, &theme, &html_config)
318+
.chain_err(|| "Unable to copy across static files")?;
319+
self.copy_additional_css_and_js(book)
320+
.chain_err(|| "Unable to copy across additional CSS and JS")?;
319321

320322
// Copy all remaining files
321323
let src = book.source_dir();

0 commit comments

Comments
 (0)