add more specific reason why it fails to parse

This commit is contained in:
Guanqun Lu 2017-05-14 13:19:06 +08:00
parent 18070f4041
commit 7783b4c0b6

View File

@ -261,8 +261,9 @@ macro_rules! create_config {
match parsed.try_into() {
Ok(parsed_config) =>
Ok(Config::default().fill_from_parsed_config(parsed_config)),
Err(_) => {
err.push_str("Error: Decoding config file failed. ");
Err(e) => {
err.push_str("Error: Decoding config file failed:\n");
err.push_str(format!("{}\n", e).as_str());
err.push_str("Please check your config file.\n");
Err(err)
}