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
@@ -112,9 +112,14 @@ bytes compileFirstExpression(
if (!sourceUnit)
return bytes();
}
catch(boost::exception const& _e)
catch (boost::exception const& _e)
{
auto msg = std::string("Parsing source code failed with: \n") + boost::diagnostic_information(_e);
string msg = "Parsing source code failed with:\n" + boost::diagnostic_information(_e);
BOOST_FAIL(msg);
}
catch (...)
{
string msg = "Parsing source code failed with:\n" + boost::current_exception_diagnostic_information();
BOOST_FAIL(msg);
}