Skip to content

Commit

Permalink
Unrecognized command line parameter crash fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderSuprunenko committed Mar 19, 2019
1 parent 0c5c9f9 commit d864a4d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/supernode/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,17 @@ bool GraftServer::initConfigOption(int argc, const char** argv, ConfigOpts& conf
#endif
("log-format", po::value<std::string>(), "e.g. %datetime{%Y-%M-%d %H:%m:%s.%g} %level %logger %rfile %msg");

po::store(po::parse_command_line(argc, argv, desc), vm);
try
{
po::store(po::parse_command_line(argc, argv, desc), vm);
}
catch(std::exception& ex)
{
std::cout << "Exception : " << ex.what() << "\n";
usage(desc);
exit(EXIT_FAILURE);
}

po::notify(vm);

if (vm.count("help")) {
Expand Down

0 comments on commit d864a4d

Please sign in to comment.