18 struct NestedException {
20 std::optional < std::string > desc;
22 explicit NestedException ( std::string type_, std::string desc_ );
23 explicit NestedException ( std::string type_ );
31 template <
typename ... Params >
33 exceptions.emplace_back ( std::forward < std::string > ( params ) ... );
36 const std::vector < NestedException > &
getExceptions ( )
const {
return exceptions; }
39 std::vector < NestedException > exceptions;
43 static int handlerRec ( NestedExceptionContainer & output,
const std::vector < std::function <
int ( NestedExceptionContainer & ) > >::const_reverse_iterator & iter );
45 static std::vector < std::function < int ( NestedExceptionContainer & ) > > & handlers ( );
47 template <
class ExceptionType >
48 static void addHandlerDeduce ( std::function <
void ( NestedExceptionContainer &,
const ExceptionType & ) > handler,
int result ) {
49 handlers ( ).push_back ( [ = ] ( NestedExceptionContainer & output ) {
52 }
catch (
const ExceptionType &
exception ) {
54 return ExceptionHandler::rethrow_if_nested ( output,
exception,
result );
59 static int rethrow_if_nested ( NestedExceptionContainer &,
const std::exception & e,
int result );
62 static int handle ( NestedExceptionContainer & output );
65 template <
int Result,
class Callable >
67 addHandlerDeduce ( std::function ( handler ), Result );
Definition: ExceptionHandler.hpp:29
void push_back(Params &&... params)
Definition: ExceptionHandler.hpp:32
const std::vector< NestedException > & getExceptions() const
Definition: ExceptionHandler.hpp:36
Definition: ExceptionHandler.hpp:16
static int handle(NestedExceptionContainer &output)
Definition: ExceptionHandler.cpp:64
static void addHandler(Callable handler)
Definition: ExceptionHandler.hpp:66
friend ext::ostream & operator<<(ext::ostream &os, const NestedException &exception)
Definition: ExceptionHandler.cpp:19
Definition: ExceptionHandler.cpp:13
for(const StateType &state :fsm.getStates()) renamingData.insert(std Rename::RenamedAutomaton< T > result(renamingData.at(fsm.getInitialState()))
Definition: Rename.h:253
Definition: CommonException.cpp:18