diff options
| author | Phil Nash | 2011-04-08 19:44:22 +0100 |
|---|---|---|
| committer | Phil Nash | 2011-04-08 19:44:22 +0100 |
| commit | 381fffe07d3ade6ef0c7bfc57acf67a3d6f5352b (patch) | |
| tree | bb259df5ebc81422f70f0020142d4e373f2c97c5 | |
| parent | 3e512bd3164b4239e6fbfeb918f4ae56ac1e2caf (diff) | |
| download | catch3-381fffe07d3ade6ef0c7bfc57acf67a3d6f5352b.tar.gz | |
Extract what() message from std::exceptions in _NO_THROW()
| -rw-r--r-- | internal/catch_capture.hpp | 4 |
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 ); \ |