Making sure errors in the enb.conf is handled gracefully

This commit is contained in:
Pedro Alvarez 2019-04-12 14:38:06 +01:00 committed by Andre Puschmann
parent 1bac758a85
commit 435d63b871
1 changed files with 9 additions and 2 deletions

View File

@ -212,8 +212,15 @@ void parse_args(all_args_t *args, int argc, char* argv[]) {
cout << "Failed to read configuration file " << config_file << " - exiting" << endl;
exit(1);
}
bpo::store(bpo::parse_config_file(conf, common), vm);
bpo::notify(vm);
// parse config file and handle errors gracefully
try {
bpo::store(bpo::parse_config_file(conf, common), vm);
bpo::notify(vm);
} catch (const boost::program_options::error& e) {
cerr << e.what() << endl;
exit(1);
}
// Convert hex strings
{