Improved custom exception handling

This commit is contained in:
Phil Nash
2011-04-20 19:09:41 +01:00
parent 9430a2c4c8
commit 5d7b054f14
4 changed files with 71 additions and 31 deletions

View File

@@ -735,7 +735,7 @@ inline bool isTrue
} \
catch( ... ) \
{ \
INTERNAL_CATCH_ACCEPT_EXPR( Catch::ResultBuilder( __FILE__, __LINE__, macroName, #expr ).setResultType( Catch::ResultWas::ThrewException ), stopOnFailure ); \
INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ResultBuilder( __FILE__, __LINE__, macroName, #expr ) << Catch::Hub::getExceptionTranslatorRegistry().translateActiveException() ).setResultType( Catch::ResultWas::ThrewException ), stopOnFailure ); \
}
///////////////////////////////////////////////////////////////////////////////
@@ -759,7 +759,7 @@ inline bool isTrue
INTERNAL_CATCH_THROWS( expr, exceptionType, stopOnFailure, macroName ) \
catch( ... ) \
{ \
INTERNAL_CATCH_ACCEPT_EXPR( Catch::ResultBuilder( __FILE__, __LINE__, macroName, #expr ).setResultType( Catch::ResultWas::ThrewException ), stopOnFailure ); \
INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ResultBuilder( __FILE__, __LINE__, macroName, #expr ) << Catch::Hub::getExceptionTranslatorRegistry().translateActiveException() ).setResultType( Catch::ResultWas::ThrewException ), stopOnFailure ); \
}
///////////////////////////////////////////////////////////////////////////////