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:
parent
ef9150fe6f
commit
86da2846af
7 changed files with 28 additions and 34 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue