diff --git a/util/assert_util.h b/util/assert_util.h index 5943636f94f..244fb2287e1 100644 --- a/util/assert_util.h +++ b/util/assert_util.h @@ -249,7 +249,10 @@ namespace mongo { #define MONGO_DESTRUCTOR_GUARD( expression ) \ try { \ expression; \ - } catch ( ... ) { problem() << "caught unknown exception in destructor " << __FUNCTION__ << endl; } - + } catch ( const std::exception &e ) { \ + problem() << "caught exception (" << e.what() << ") in destructor (" << __FUNCTION__ << ")" << endl; \ + } catch ( ... ) { \ + problem() << "caught unknown exception in destructor (" << __FUNCTION__ << ")" << endl; \ + } #undef MONGO_NORETURN