Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
ExceptionError_test Class Reference

Description

Some aspects of C++ exception handling.

Not to be confused with the basic C-style error value mechanism used by the low-level parts of the vault. Both approaches are largely orthogonal, but the C++ exception handling uses the C-style error constants.

Definition at line 58 of file exception-error-test.cpp.

Classes

class  SpecificError
 a very specific Exception class local to this scope and with additional behaviour. More...
 

Private Types

typedef ExceptionError_test test
 

Private Member Functions

virtual void run (Arg)
 
void throwSpecial (string)
 
void throwDerived (string)
 
void throwFatal (string _)
 
void throwInvalid (string _)
 
void throwExternal (string _)
 
void throwRuntime (string _)
 
void throwExceptn (string)
 
void nestedThrower (string msg)
 
void doubleNestedTh (string msg)
 
void detectErrorflag (string)
 
void checkErrorFlagPropagation ()
 
void checkRootCauseChaining ()
 
void catcher (void(ExceptionError_test::*funky)(string), string context="")
 helper: provides a bunch of catch-clauses and runs the given member functions within
 

Member Typedef Documentation

◆ test

typedef ExceptionError_test test
private

Definition at line 60 of file exception-error-test.cpp.

Member Function Documentation

◆ run()

◆ throwSpecial()

void throwSpecial ( string  )
inlineprivate
Test:
simply throw some exception and pass context info

Definition at line 83 of file exception-error-test.cpp.

Referenced by ExceptionError_test::run().

+ Here is the caller graph for this function:

◆ throwDerived()

void throwDerived ( string  )
inlineprivate

Definition at line 84 of file exception-error-test.cpp.

Referenced by ExceptionError_test::run().

+ Here is the caller graph for this function:

◆ throwFatal()

void throwFatal ( string  _)
inlineprivate

Definition at line 85 of file exception-error-test.cpp.

References _.

Referenced by ExceptionError_test::run().

+ Here is the caller graph for this function:

◆ throwInvalid()

void throwInvalid ( string  _)
inlineprivate

Definition at line 86 of file exception-error-test.cpp.

References _.

Referenced by ExceptionError_test::run().

+ Here is the caller graph for this function:

◆ throwExternal()

void throwExternal ( string  _)
inlineprivate

Definition at line 87 of file exception-error-test.cpp.

References _.

Referenced by ExceptionError_test::nestedThrower(), and ExceptionError_test::run().

+ Here is the caller graph for this function:

◆ throwRuntime()

void throwRuntime ( string  _)
inlineprivate

Definition at line 88 of file exception-error-test.cpp.

References _.

Referenced by ExceptionError_test::run().

+ Here is the caller graph for this function:

◆ throwExceptn()

void throwExceptn ( string  )
inlineprivate

Definition at line 89 of file exception-error-test.cpp.

Referenced by ExceptionError_test::run().

+ Here is the caller graph for this function:

◆ nestedThrower()

void nestedThrower ( string  msg)
inlineprivate
Test:
catching, repackaging and rethrowing of errors. This feature is important for passing exceptions transparently over several layers. The nested operation will throw an error::External, which we are able to catch because it is derived from std::exception. We don't need to know the exact type, but we can classify the error situation as a "state error" and throw an error::State, passing on the root cause. Some levels up, this error get caught and the root cause can be extracted successfully.

Definition at line 101 of file exception-error-test.cpp.

References ExceptionError_test::throwExternal().

Referenced by ExceptionError_test::doubleNestedTh(), and ExceptionError_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doubleNestedTh()

void doubleNestedTh ( string  msg)
inlineprivate
Test:
repeated repackaging and rethrowing

Definition at line 113 of file exception-error-test.cpp.

References ExceptionError_test::nestedThrower(), and Error::what().

Referenced by ExceptionError_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ detectErrorflag()

void detectErrorflag ( string  )
inlineprivate

Definition at line 125 of file exception-error-test.cpp.

References lumiera::throwOnError().

Referenced by ExceptionError_test::checkErrorFlagPropagation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkErrorFlagPropagation()

void checkErrorFlagPropagation ( )
inlineprivate
Test:
verify throwing of Exceptions based on a non-cleared C error flag

Definition at line 131 of file exception-error-test.cpp.

References ExceptionError_test::catcher(), ExceptionError_test::detectErrorflag(), lumiera_error_peek(), and lumiera_error_set().

Referenced by ExceptionError_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkRootCauseChaining()

void checkRootCauseChaining ( )
inlineprivate
Test:
the chaining of lumiera::Exception objects and the retrieval of the original root cause.

Definition at line 144 of file exception-error-test.cpp.

References Error::rootCause().

Referenced by ExceptionError_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ catcher()

void catcher ( void(ExceptionError_test::*)(string)  funky,
string  context = "" 
)
inlineprivate

helper: provides a bunch of catch-clauses and runs the given member functions within

Definition at line 190 of file exception-error-test.cpp.

References ExceptionError_test::SpecificError::revealIt(), and Error::what().

Referenced by ExceptionError_test::checkErrorFlagPropagation(), and ExceptionError_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:
+ Inheritance diagram for ExceptionError_test:
+ Collaboration diagram for ExceptionError_test:

The documentation for this class was generated from the following file: