From db13d8e561d1595bf731a1a90c4dc8138c0a9636 Mon Sep 17 00:00:00 2001 From: Tjeu Kayim <15987676+TjeuKayim@users.noreply.github.com> Date: Sun, 22 Sep 2019 14:27:14 +0200 Subject: [PATCH] Log HtmlConfig deserialization errors --- src/config.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index 17c941d2..02452447 100644 --- a/src/config.rs +++ b/src/config.rs @@ -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`. @@ -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 { - 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