An example of using the chsv_monitor_exceptions and chsv_list_of_exceptions macros.
#include <iostream>
void f3()
{
}
void f2()
{
f3();
}
struct Obj
{
void fo()
{
f2();
}
};
void f1()
{
Obj x;
x.fo();
}
int wmain(int argc, wchar_t **argv)
{
try
{
f1();
{
std::wcout << L
"Exception caught: " << ex.
What() << std::endl;
std::wcout << L"Stack trace (from top to bottom):\n";
size_t i = 0;
std::wcout << ++i << L") " << entry.Record() << std::endl;
}
return 0;
}
The file contains definitions of various exceptions thrown by the mechanisms of the chsvcode library ...
Defines a class of objects specifying various exceptions with extended support for description format...
Definition: chsvexception.h:392
virtual const wchar_t * What() const noexcept
Returns a description, corresponding to the exception, represented as a wide string.
Definition: chsvexception.h:573
#define chsv_monitor_exceptions
Turns on exception tracing during stack unwinding within a function.
Definition: chsvexception.h:5216
void ChsvExceptionByPosixCode(errno_t nCode, const char *restrict pszDescription, DescriptionFormatParams ... format_params)
Creates an instance of the ChsvCodeExceptionTempl class and throws it as an exception....
Definition: chsvexception.h:4259
#define chsv_list_of_exceptions
Returns a list of registered exceptions thrown within a current thread with the front elements being ...
Definition: chsvexception.h:5235