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
+4 -4
View File
@@ -306,13 +306,13 @@ void SourceUpgrade::tryCompile() const
{
error() << "Exception during compilation: " << boost::diagnostic_information(_exception) << endl;
}
catch (std::exception const& _e)
catch (std::exception const& _exception)
{
error() << (_e.what() ? ": " + string(_e.what()) : ".") << endl;
error() << "Exception during compilation: " << boost::diagnostic_information(_exception) << endl;
}
catch (...)
{
error() << "Unknown exception during compilation." << endl;
error() << "Unknown exception during compilation: " << boost::current_exception_diagnostic_information() << endl;
}
}
@@ -517,7 +517,7 @@ ReadCallback::Callback SourceUpgrade::fileReader()
}
catch (...)
{
return ReadCallback::Result{false, "Unknown exception in read callback."};
return ReadCallback::Result{false, "Unknown exception in read callback: " + boost::current_exception_diagnostic_information()};
}
};