summaryrefslogtreecommitdiffstats
path: root/src/config.rs
diff options
context:
space:
mode:
authorTjeu Kayim <15987676+TjeuKayim@users.noreply.github.com>2019-09-22 14:27:14 +0200
committerTjeu Kayim <15987676+TjeuKayim@users.noreply.github.com>2019-09-22 21:48:03 +0200
commitdb13d8e561d1595bf731a1a90c4dc8138c0a9636 (patch)
treeaeb80e8b7fc4010cff5188c0e23410db88803a4e /src/config.rs
parentbb7a863d3ebec3f3eb2e63992358f86f662016cc (diff)
Log HtmlConfig deserialization errors
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs9
1 files changed, 8 insertions, 1 deletions
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<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