30using std::runtime_error;
104 catch (std::exception& e)
106 cout <<
"intermediate handler caught: " << e.what()
107 <<
"....will rethrow as error::State\n";
118 cout <<
"2nd intermediate handler caught: " << e.
what()
119 <<
"....will rethrow as error::Config\n";
151 std::runtime_error rerr(
"what a shame");
155 CHECK (err2.rootCause() == err1.what());
156 CHECK (err3.rootCause() == err1.what());
157 CHECK (err4.
rootCause() == err1.rootCause());
159 CHECK (err5.rootCause() == rerr.what());
174 :
error::Invalid{
"don't panic", LUMIERA_ERROR_LIFE_AND_UNIVERSE}
194 (this->*funky) (context);
198 catch (
error::Logic& e) { cout <<
"caught error::Logic: " << e.
what() <<
"\n"; }
200 catch (
Error& e) { cout <<
"caught lumiera::Error: " << e.
what() <<
"\n"; }
201 catch (runtime_error& e) { cout <<
"caught std::runtime_error: " << e.
what() <<
"\n"; }
202 catch (exception& e) { cout <<
"caught std::exception. (unspecific)" <<
"\n"; }
203 catch (...) { cout <<
"caught an unknown exception\n"; }
Interface and Base definition for all Lumiera Exceptions.
virtual CStr what() const noexcept override
std::exception interface : yield a diagnostic message
string const & rootCause() const noexcept
If this exception was caused by a chain of further exceptions, return the description of the first on...
Derived specific exceptions within Lumiera's exception hierarchy.
a very specific Exception class local to this scope and with additional behaviour.
Some aspects of C++ exception handling.
void throwExternal(string _)
void throwSpecial(string)
void catcher(void(ExceptionError_test::*funky)(string), string context="")
helper: provides a bunch of catch-clauses and runs the given member functions within
void throwExceptn(string)
void checkErrorFlagPropagation()
void checkRootCauseChaining()
void throwFatal(string _)
void detectErrorflag(string)
void throwRuntime(string _)
void nestedThrower(string msg)
void throwDerived(string)
void throwInvalid(string _)
void doubleNestedTh(string msg)
lumiera_err lumiera_error_peek(void)
Check current error state without clearing it Please avoid this function and use lumiera_error() if p...
lumiera_err lumiera_error_set(lumiera_err nerr, const char *extra)
Set error state for the current thread.
Lumiera error handling (C interface).
#define LUMIERA_ERROR_DEFINE(err, msg)
Definition and initialisation of an error constant.
#define LUMIERA_ERROR_DECLARE(err)
Forward declare an error constant.
Lumiera error handling (C++ interface).
LumieraError< LERR_(STATE)> State
LumieraError< LERR_(FATAL), Logic > Fatal
LumieraError< LERR_(LOGIC)> Logic
LumieraError< LERR_(CONFIG), Invalid > Config
LumieraError< LERR_(INVALID)> Invalid
LumieraError< LERR_(EXTERNAL)> External
error::LumieraError< LUMIERA_ERROR_DERIVED, error::External > DerivedError
define a specific Error subclass derived from error::external
Lumiera public interface.
void throwOnError()
Check the lumiera error state, which maybe was set by C-code.
Test runner and basic definitions for tests.
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...