Skip to content

Commit

Permalink
Log HtmlConfig deserialization errors
Browse files Browse the repository at this point in the history
  • Loading branch information
TjeuKayim committed Sep 22, 2019
1 parent bb7a863 commit db13d8e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ use toml_query::insert::TomlValueInsertExt;
use toml_query::read::TomlValueReadExt;

use crate::errors::*;
use crate::utils;

/// The overall configuration object for MDBook, essentially an in-memory
/// representation of `book.toml`.
Expand Down Expand Up @@ -168,7 +169,13 @@ impl Config {
/// HTML renderer is refactored to be less coupled to `mdbook` internals.
#[doc(hidden)]
pub fn html_config(&self) -> Option<HtmlConfig> {
self.get_deserialized("output.html").ok()
match self.get_deserialized("output.html") {
Ok(config) => Some(config),
Err(e) => {
utils::log_backtrace(&e.chain_err(|| "Parsing configuration [output.html]"));
None
}
}
}

/// Convenience function to fetch a value from the config and deserialize it
Expand Down

0 comments on commit db13d8e

Please sign in to comment.