22 #include <boost/exception/diagnostic_information.hpp>
26 this->
frames_to_cut_ = {
"boost",
"exception_detail",
"throw_exception"};
32 : stack_trace_(other.stack_trace_), frames_to_cut_(other.frames_to_cut_) {}
50 static std::string message(1024,
' ');
54 std::ostringstream converter;
56 if (EI_NestedMessage::ptr(*
this)) {
57 converter <<
"--------------------------------------------------------" << std::endl;
58 converter <<
"Nested exception:" << *(EI_NestedMessage::ptr(*
this)) << std::endl;
60 if (EI_Nested::ptr(*
this)) {
61 std::shared_ptr<ExceptionBase> exc_ptr = *EI_Nested::ptr(*
this);
63 converter <<
"--------------------------------------------------------" << std::endl;
64 converter <<
"Nested exception:" << std::endl;
65 exc_ptr->form_message(converter);
66 if (EI_NestedMessage::ptr(*exc_ptr)) {
67 converter <<
"--------------------------------------------------------" << std::endl;
68 converter <<
"Nested exception:" << *(EI_NestedMessage::ptr(*exc_ptr)) << std::endl;
71 if (EI_Nested::ptr(*exc_ptr)) {
72 exc_ptr = *EI_Nested::ptr(*exc_ptr);
78 message = converter.str();
79 return message.c_str();
81 }
catch (std::exception &exc) {
82 std::cerr <<
"*** Exception encountered in exception handling routines ***" << std::endl <<
"*** Message is " << std::endl
83 << exc.what() << std::endl <<
"*** Aborting! ***" << std::endl;
87 std::cerr <<
"*** Exception encountered in exception handling routines ***" << std::endl <<
"*** Aborting! ***"
97 return "Program Error: ";
103 converter <<
"--------------------------------------------------------" << std::endl;
107 converter <<
"\n** Diagnosting info **\n" ;
108 converter << boost::diagnostic_information_what( *
this );
110 converter << std::endl <<
"--------------------------------------------------------" << std::endl;