mirror of
https://github.com/ETLCPP/etl.git
synced 2026-06-28 13:28:43 +08:00
Added raise_error free function that will either throw the error (if ETL_THROW_EXCEPTIONS is defined) or call error_handler::error.
This commit is contained in:
parent
13c024bd9c
commit
779e313e11
@ -78,6 +78,21 @@ namespace etl
|
||||
|
||||
static ifunction<const exception&>* 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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user