
On Wed, Jun 27, 2012 at 4:46 AM, Leo Goodstadt <leo.goodstadt@llew.org.uk>wrote:
However, the majority of exceptions in program_options are there to indicate a problem in the construction of the command line by the *end-user* (not the programmer). In other words, the program *is* working exactly as designed.
Unless it's buggy. The
programmer has no interest in the provenance of these exceptions *except* that they can be used to inform the end-user how they should retype the command line and try again.
The use case is this: int main( int argc, char const * argv[] ) { try { do_work(parse_command_line(argc,argv)); } catch( X & ) { } catch( Y & ) { } catch(...) { std::cerr << boost::current_exception_diagnostic_information(); abort(); } } The catch(...) shouldn't be reached. The BOOST_THROW_EXCEPTION information could help if it is (of course the message is intended for the programmer, not the end user.) Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode