Use boost::current_exception_diagnostic_information() to print extra info about exceptions caught by (...)

This commit is contained in:
Kamil Śliwak
2021-10-07 17:41:25 +02:00
parent daf61a4c90
commit a30348715b
7 changed files with 26 additions and 15 deletions
+2 -4
View File
@@ -201,15 +201,13 @@ TestTool::Result TestTool::process()
catch (std::exception const& _e)
{
AnsiColorized(cout, formatted, {BOLD, RED}) <<
"Exception during test" <<
(_e.what() ? ": " + string(_e.what()) : ".") <<
endl;
"Exception during test: " << boost::diagnostic_information(_e) << endl;
return Result::Exception;
}
catch (...)
{
AnsiColorized(cout, formatted, {BOLD, RED}) <<
"Unknown exception during test." << endl;
"Unknown exception during test: " << boost::current_exception_diagnostic_information() << endl;
return Result::Exception;
}
}