From 779e313e11a339205bb9e158b48436a793c9d1d7 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Wed, 19 Aug 2015 14:36:18 +0100 Subject: [PATCH] Added raise_error free function that will either throw the error (if ETL_THROW_EXCEPTIONS is defined) or call error_handler::error. --- error_handler.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/error_handler.h b/error_handler.h index 4fd697d5..e4050391 100644 --- a/error_handler.h +++ b/error_handler.h @@ -78,6 +78,21 @@ namespace etl static ifunction* p_ifunction; }; + + //*************************************************************************** + /// Raise an error. + /// If ETL_THROW_EXCEPTIONS is defined then the error is thrown, otherwise + /// the error handler is called. + ///\ingroup error_handler + //*************************************************************************** + inline void raise_error(const exception& e) + { +#ifdef ETL_THROW_EXCEPTIONS + throw e; +#else + error_handler::error(e); +#endif + } } #endif