mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-20 11:35:39 +02:00
Replace most naked throws with macros from catch_enforce.h
This is a first step towards support a no-exceptions mode
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
throw CATCH_PREPARE_EXCEPTION( std::logic_error, CATCH_INTERNAL_LINEINFO << ": Internal Catch error: " << msg);
|
||||
#define CATCH_ERROR( msg ) \
|
||||
throw CATCH_PREPARE_EXCEPTION( std::domain_error, msg )
|
||||
#define CATCH_RUNTIME_ERROR( msg ) \
|
||||
throw CATCH_PREPARE_EXCEPTION( std::runtime_error, msg )
|
||||
#define CATCH_ENFORCE( condition, msg ) \
|
||||
do{ if( !(condition) ) CATCH_ERROR( msg ); } while(false)
|
||||
|
||||
|
Reference in New Issue
Block a user