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:
Martin Hořeňovský 2018-09-03 10:03:47 +02:00
parent ef9150fe6f
commit 86da2846af
7 changed files with 28 additions and 34 deletions

View file

@ -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)