Thanks for the suggestion, I was not aware of boost::current_exception_diagnostic_information(), looks useful!
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Emil Dotchevski Sent: Wednesday, July 15, 2009 2:42 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Unable to catch exception using boost::asio
On Wed, Jul 15, 2009 at 11:31 AM, Alex Black
wrote: Thanks, that fixed it!
My destructor now looks like this:
try { m_pProtoBufStream.reset(); } catch ( std::exception& e ) { cout << endl << "Unexpected exception in ProtoBufStreamAdaptor::~ProtoBufStreamAdaptor: " << e.what() << endl; } catch ( ... ) { cout << endl << "Unexpected exception in ProtoBufStreamAdaptor::~ProtoBufStreamAdaptor" << endl; }
And it does indeed catch an exception. Now my process doesn't die.
I'd replace this with:
try { m_pProtoBufStream.reset(); } catch ( ... ) { cout << endl << "Unexpected exception caught in " << BOOST_CURRENT_FUNCTION << endl << boost::current_exception_diagnostic_information(); }
(you'd need to #include
) Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users