
On Wed, May 13, 2009 at 11:26 PM, Adam Badura <abadura@o2.pl> wrote:
Currently we can chain exceptions with boost::exception by constructing a new boost::exception and injecting to it error_info<struct nested_exception_tag, exception_ptr> with exception taken by current_exception. However at the catch site there is little we can do with exception_ptr without rethrowing it to catch it and print diagnostic data. How about allowing diagnostic data for exception_ptr?
If you don't insist on the diagnostic message to be user-friendly, just use current_exception_diagnostic_information: boost::exception_ptr p; ... try { boost::rethrow_exception(p); } catch(...) { std::cerr << boost::current_exception_diagnostic_information(); } You can also catch( boost::exception & ), in which case you can use get_error_info to probe the exception for data. You can't do better than that without *knowing* what the exception is and what it indicates in your particular program. Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode