Boost logo

Boost Users :

Subject: Re: [Boost-users] [Test] Making use of boost::exception_diagnostic_information and friends
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2009-08-10 04:28:54


Emil Dotchevski <emildotchevski <at> gmail.com> writes:

> > I want to have a bit more flexibility as to what and how I print.
> > I'll need to get a hold of each component separately.
>
> Reporting unexpected exceptions by a testing framework is pretty much
> perfect use case for boost::current_exception_diagnostic_information;
> if the data in the returned string is not sufficient for diagnostic
> purposes, then the function itself should be modified to return a
> better string.

The data probably is sufficient. I just want to format it differently (and in
different place) and more importantly I want to allow users to format it as they
please.
 
> Since the testing framework wouldn't know anything about the exception
> it's reporting, it should catch(...) and leave it up to
> current_exception_diagnostic_information to provide all the
> information it can dig out from whatever the current exception may be.

1. It will never get to the catch(...) execution monitor has tons of other catch
clauses (including catch (std::exception)) which will trigger first.

2. execution monitor is very careful about memory being used. How about
diagnostic_information?

3. I pretty much only need file, line and function name. Are you saying I can't
do what you are doing inside diagnostic information to get a hold of them?

Gennadiy


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