From 2fdf92770435bf8f0094ce04c2576be66d64982c Mon Sep 17 00:00:00 2001 From: orignal Date: Thu, 11 Feb 2016 10:54:36 -0500 Subject: [PATCH] show actual name of an invalid parameter --- Config.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Config.cpp b/Config.cpp index 9e9582ea..46816e45 100644 --- a/Config.cpp +++ b/Config.cpp @@ -204,19 +204,22 @@ namespace config { } void ParseConfig(const std::string& path) { - if (path == "") - return; + if (path == "") return; std::ifstream config(path, std::ios::in); - if (!config.is_open()) { + if (!config.is_open()) + { std::cerr << "missing/unreadable config file: " << path << std::endl; exit(EXIT_FAILURE); } - try { - store(boost::program_options::parse_config_file(config, m_OptionsDesc), m_Options); - } catch (boost::program_options::error e) { + try + { + store(boost::program_options::parse_config_file(config, m_OptionsDesc), m_Options); + } + catch (boost::program_options::error& e) + { std::cerr << e.what() << std::endl; exit(EXIT_FAILURE); };