On Sun, Aug 9, 2009 at 1:27 PM, Gennadiy Rozental
Emil Dotchevski
writes: I'm not familiar with the test runner, but assuming that it is written in C++, all it needs is something like:
#include
.... catch(...) { std::cerr << boost::current_exception_diagnostic_information(); }
This will print the what() message (if available) too.
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. I welcome patches (including platform-specific hacks) that would provide more useful diagnostic information about exceptions.
Also I want to catch boost::exception by specific clause. It should be fine, right? Will I need to place it first in my list of catch clauses? Cause AFAIK actual type will inherit both boost::exception and the exception type being thrown.
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. Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode