Lumiera  0.pre.03
»edit your freedom«
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

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

Member Function Documentation

◆ throwSpecial()

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

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

◆ 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.

Referenced by ExceptionError_test::doubleNestedTh().

+ 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().

+ Here is the call 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(), lumiera_error_peek(), and lumiera_error_set().

+ Here is the call 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().

+ Here is the call 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: