Boost logo

Boost Users :

From: Ian McCulloch (ianmcc_at_[hidden])
Date: 2005-11-21 13:15:38


Merrill Cornish wrote:

[...]

> }//try
> catch(std::exception e) {
> cerr << "Exception:" << endl;
> cerr << e.what() << endl;
> exit(EXIT_FAILURE);
> }//catch
> catch(...) {
> cerr << "An unknown exception occurs while parsing :
> "command line arguments." << endl;
> exit(EXIT_FAILURE);
> }//catch
>
>
> Using the 'try' in the position shown above, if I input an unexpected
> command line options, an exceptioin is thrown whose what() method returns
> "St9exception".
> That's it. Just "St9exception". I can't find that string in the Boost
> source anywhere.

You are catching the exception by value. That will slice the derived
object, and lose the exception info. Catch by reference instead and you
might see something more useful.

HTH,
Ian McCulloch


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net