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ý committed 2018-09-03 18:07:34 +02:00
1 parent ef9150fe6f
commit 86da2846af
7 files changed
+28 -34

No files matched your search

+2
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)