From 7783b4c0b60506f1e1aef0ef4e4711d6fc5893e7 Mon Sep 17 00:00:00 2001 From: Guanqun Lu Date: Sun, 14 May 2017 13:19:06 +0800 Subject: [PATCH] add more specific reason why it fails to parse --- src/config.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/config.rs b/src/config.rs index 441f86f48cbf..632170e68124 100644 --- a/src/config.rs +++ b/src/config.rs @@ -261,8 +261,9 @@ pub fn from_toml(toml: &str) -> Result { 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) }