diff --git a/include/fc/exception/exception.hpp b/include/fc/exception/exception.hpp index 984fca5..894f575 100644 --- a/include/fc/exception/exception.hpp +++ b/include/fc/exception/exception.hpp @@ -289,13 +289,18 @@ namespace fc * @brief Checks a condition and throws an assert_exception if the test is FALSE */ #define FC_ASSERT( TEST, ... ) \ -FC_EXPAND_MACRO( \ -do { if( !(TEST) ) { FC_THROW_EXCEPTION( fc::assert_exception, #TEST ": " __VA_ARGS__ ); } } while(0); \ -) + FC_EXPAND_MACRO( \ + do { if( !(TEST) ) { FC_THROW_EXCEPTION( fc::assert_exception, #TEST ": " __VA_ARGS__ ); } } while(0); \ + ) -#define FC_THROW( FORMAT, ... ) \ +#define FC_CAPTURE_AND_THROW( EXCEPTION_TYPE, ... ) \ + do { throw EXCEPTION_TYPE( FC_LOG_MESSAGE( error, "", FC_FORMAT_ARG_PARAMS(__VA_ARGS__) ) ); } while(false); + +//#define FC_THROW( FORMAT, ... ) + +#define FC_THROW( ... ) \ do { \ - throw fc::exception( FC_LOG_MESSAGE( error, FORMAT, __VA_ARGS__ ) ); \ + throw fc::exception( FC_LOG_MESSAGE( error, __VA_ARGS__ ) ); \ } while(0) #define FC_EXCEPTION( EXCEPTION_TYPE, FORMAT, ... ) \