Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log deserialization errors for [html.config] #1033

Merged

Conversation

TjeuKayim
Copy link
Contributor

Fixes #1032

Log deserialization errors in Config::html_config(), instead of ignoring them.
After implementing this, the log appeared three times, caused by multiple calls to html_config(). Therefore, I de-duplicated that code.

Example

Using this book.toml:

[output.html]
default-theme = "navy"
curly-quotes = "true"
# should have been: curly-quotes = true

The build log displays the error:

[~/src/mdBook]% cargo run -- build ./book-example
    Finished dev [unoptimized + debuginfo] target(s) in 0.07s
     Running `target/debug/mdbook build ./book-example`
2019-09-22 21:19:14 [INFO] (mdbook::book): Book building has started
2019-09-22 21:19:14 [INFO] (mdbook::book): Running the html backend
2019-09-22 21:19:14 [ERROR] (mdbook::utils): Error: Parsing configuration [output.html]
2019-09-22 21:19:14 [ERROR] (mdbook::utils):    Caused By: Couldn't deserialize the value
2019-09-22 21:19:14 [ERROR] (mdbook::utils):    Caused By: invalid type: string "true", expected a boolean for key `curly-quotes`

@ehuss
Copy link
Contributor

ehuss commented Sep 26, 2019

Thanks!

@ehuss ehuss merged commit 98ecd11 into rust-lang:master Sep 26, 2019
@ehuss ehuss mentioned this pull request Sep 26, 2019
Ruin0x11 pushed a commit to Ruin0x11/mdBook that referenced this pull request Aug 30, 2020
…error-html-config

Log deserialization errors for [html.config]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not ignore HtmlConfig syntax errors silently
2 participants