Boost logo

Boost :

Subject: Re: [boost] program options (consider using BOOST_THROW_EXCEPTION)
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2012-06-27 16:51:53

On Wed, Jun 27, 2012 at 4:46 AM, Leo Goodstadt <leo.goodstadt_at_[hidden]>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.

> 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[] )
  catch( X & )
  catch( Y & )
    std::cerr << boost::current_exception_diagnostic_information();

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.

Boost list run by bdawes at, gregod at, cpdaniel at, john at