From 381fffe07d3ade6ef0c7bfc57acf67a3d6f5352b Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 8 Apr 2011 19:44:22 +0100 Subject: [PATCH] Extract what() message from std::exceptions in _NO_THROW() --- internal/catch_capture.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/catch_capture.hpp b/internal/catch_capture.hpp index 1d36a21b..6763353a 100644 --- a/internal/catch_capture.hpp +++ b/internal/catch_capture.hpp @@ -729,6 +729,10 @@ inline bool isTrue expr; \ INTERNAL_CATCH_ACCEPT_EXPR( Catch::ResultBuilder( __FILE__, __LINE__, macroName, #expr ).setResultType( Catch::ResultWas::Ok ), stopOnFailure ); \ } \ + catch( std::exception& ex ) \ + { \ + INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ResultBuilder( __FILE__, __LINE__, macroName, #expr ) << ex.what() ).setResultType( Catch::ResultWas::ThrewException ), stopOnFailure ); \ + } \ catch( ... ) \ { \ INTERNAL_CATCH_ACCEPT_EXPR( Catch::ResultBuilder( __FILE__, __LINE__, macroName, #expr ).setResultType( Catch::ResultWas::ThrewException ), stopOnFailure ); \