4 * Contains declaration of @ref CHECKPOINT.
7 #ifndef LIBFSAFE_CHECKPOINT_HXX
8 #define LIBFSAFE_CHECKPOINT_HXX
10 #include <libsex/utility.hxx>
11 #include <libfsafe/UnexpectedException.hxx>
14 * Marks an important statement in the program flow.
16 * The marked statement is executed. In the default case
17 * (the statement being successfull) nothing else will
18 * happen. If the statement throws an exception, it will be
19 * wrapped into anther exception that contains the location
20 * and the statement itsself.
22 * Used to create concise backtraces that contain the
23 * original exception(s) and the most important (=marked)
24 * statements of the current call stack.
26 * @param statement The statement to mark and execute.
27 * @throws libfsafe::UnexpectedException If statement throws.
30 #define CHECKPOINT(statement) \
33 } catch (libsex::Exception& e) { \
34 throw libsex::formatted<libfsafe::UnexpectedException>(e, __FILE__, __LINE__, #statement); \