Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPhil Nash2011-04-08 19:44:22 +0100
committerPhil Nash2011-04-08 19:44:22 +0100
commit381fffe07d3ade6ef0c7bfc57acf67a3d6f5352b (patch)
treebb259df5ebc81422f70f0020142d4e373f2c97c5
parent3e512bd3164b4239e6fbfeb918f4ae56ac1e2caf (diff)
downloadcatch3-381fffe07d3ade6ef0c7bfc57acf67a3d6f5352b.tar.gz
Extract what() message from std::exceptions in _NO_THROW()
-rw-r--r--internal/catch_capture.hpp4
1 files changed, 4 insertions, 0 deletions
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 ); \