28 #include "../include/charon-core/ExceptionHandler.h"
29 #include "../include/charon-core/TypeDetector.h"
30 #include "../include/charon-core/SplitStream.h"
33 int ret = EXIT_FAILURE;
37 catch (
const std::exception& e) {
38 const char* name =
typeid(e).name();
40 name = abi::__cxa_demangle(name, 0, 0, 0);
42 std::cerr <<
"\n(EE) Caught exception of type " << name <<
".\n";
43 std::cerr <<
"(EE) Message:\n(EE) \t" << e.what() << std::endl;
45 catch (
const std::string& e) {
46 std::cerr <<
"\n(EE) Caught exception of type std::string.\n";
47 std::cerr <<
"(EE) Message:\n(EE) \t" << e << std::endl;
49 catch (
const char*& e) {
50 std::cerr <<
"\n(EE) Caught exception of type const char*.\n";
51 std::cerr <<
"(EE) Message:\n(EE) \t" << e << std::endl;
54 std::cerr <<
"\n(EE) Caught unknown exception." << std::endl;
64 catch (
const std::exception& e) {
65 const char* name =
typeid(e).name();
67 name = abi::__cxa_demangle(name, 0, 0, 0);
69 std::cerr <<
"\n(EE) Caught exception of type " << name <<
".\n";
70 std::cerr <<
"(EE) Message:\n(EE) \t" << e.what() << std::endl;
73 catch (
const std::string& e) {
74 std::cerr <<
"\n(EE) Caught exception of type std::string.\n";
75 std::cerr <<
"(EE) Message:\n(EE) \t" << e << std::endl;
78 catch (
const char*& e) {
79 std::cerr <<
"\n(EE) Caught exception of type const char*.\n";
80 std::cerr <<
"(EE) Message:\n(EE) \t" << e << std::endl;
84 std::cerr <<
"\n(EE) Caught unknown exception." << std::endl;
87 return excpt ? EXIT_FAILURE : EXIT_SUCCESS;
95 catch (
const std::exception& e) {
96 const char* name =
typeid(e).name();
98 name = abi::__cxa_demangle(name, 0, 0, 0);
100 sout <<
"(II) Caught exception of type " << name <<
".\n";
101 sout <<
"(II) Message:\n(II) \t" << e.what() << std::endl;
104 catch (
const std::string& e) {
105 sout <<
"(II) Caught exception of type std::string.\n";
106 sout <<
"(II) Message:\n(II) \t" << e << std::endl;
109 catch (
const char*& e) {
110 sout <<
"(II) Caught exception of type const char*.\n";
111 sout <<
"(II) Message:\n(II) \t" << e << std::endl;
115 sout <<
"(II) Caught unknown exception." << std::endl;
121 sout <<
"\n(EE) Expected runtime error exception!" << std::endl;
SplitStream sout
Dummy instance for usage in other files (for interface too).
charon_plugins_DLL_PUBLIC int checkRaise(void(&method)())
execute given function and return EXIT_SUCCESS on exception catch
charon_plugins_DLL_PUBLIC int run(int(&method)())
Execute given function and catch exceptions.