Skip to content

Commit

Permalink
give an error message when we crash from bad command line args
Browse files Browse the repository at this point in the history
This only fixes one case but when you are trying to set up a
headless multiplayer game it is pretty annoying when it crashes
with no explanation because of a bad controller string.
  • Loading branch information
cbeck88 committed Jul 6, 2014
1 parent c8d95fb commit cff4040
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/commandline_options.cpp
Expand Up @@ -488,7 +488,9 @@ std::vector<boost::tuple<unsigned int,std::string> > commandline_options::parse_
const std::vector<std::string> tokens = utils::split(s, separator);
if (tokens.size()!=2)
{
//TODO throw a meaningful exception
std::stringstream ss;
ss << "when trying to parse string " << s << " as an (int,string) with separator " << separator << ", didn't get exactly two tokens.";
throw ss.str();
}
elem.get<0>() = lexical_cast<unsigned int>(tokens[0]);
//TODO catch exception and pack in meaningful something
Expand Down

0 comments on commit cff4040

Please sign in to comment.