mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
show actual name of an invalid parameter
This commit is contained in:
parent
6e98649607
commit
2fdf927704
15
Config.cpp
15
Config.cpp
@ -204,19 +204,22 @@ namespace config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ParseConfig(const std::string& path) {
|
void ParseConfig(const std::string& path) {
|
||||||
if (path == "")
|
if (path == "") return;
|
||||||
return;
|
|
||||||
|
|
||||||
std::ifstream config(path, std::ios::in);
|
std::ifstream config(path, std::ios::in);
|
||||||
|
|
||||||
if (!config.is_open()) {
|
if (!config.is_open())
|
||||||
|
{
|
||||||
std::cerr << "missing/unreadable config file: " << path << std::endl;
|
std::cerr << "missing/unreadable config file: " << path << std::endl;
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try
|
||||||
store(boost::program_options::parse_config_file(config, m_OptionsDesc), m_Options);
|
{
|
||||||
} catch (boost::program_options::error e) {
|
store(boost::program_options::parse_config_file(config, m_OptionsDesc), m_Options);
|
||||||
|
}
|
||||||
|
catch (boost::program_options::error& e)
|
||||||
|
{
|
||||||
std::cerr << e.what() << std::endl;
|
std::cerr << e.what() << std::endl;
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user