Merge pull request #513 from Michael-F-Bryan/error-messages

Added better error messages for missing CSS/JS
This commit is contained in:
Michael Bryan 2017-12-14 20:28:28 +11:00 committed by GitHub
commit 65acb355d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -230,7 +230,8 @@ impl HtmlHandlebars {
.chain(html.additional_js.iter()); .chain(html.additional_js.iter());
for custom_file in custom_files { for custom_file in custom_files {
self.write_custom_file(custom_file, book)?; self.write_custom_file(&custom_file, book)
.chain_err(|| format!("Copying {} failed", custom_file.display()))?;
} }
Ok(()) Ok(())
@ -312,10 +313,11 @@ impl Renderer for HtmlHandlebars {
&rendered.into_bytes())?; &rendered.into_bytes())?;
info!("[*] Creating print.html ✓"); info!("[*] Creating print.html ✓");
// Copy static files (js, css, images, ...)
debug!("[*] Copy static files"); debug!("[*] Copy static files");
self.copy_static_files(book, &theme, &html_config)?; self.copy_static_files(book, &theme, &html_config)
self.copy_additional_css_and_js(book)?; .chain_err(|| "Unable to copy across static files")?;
self.copy_additional_css_and_js(book)
.chain_err(|| "Unable to copy across additional CSS and JS")?;
// Copy all remaining files // Copy all remaining files
let src = book.source_dir(); let src = book.source_dir();