mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Improved handling of exceptions in some Solidity Tests
This commit is contained in:
parent
ab4178941b
commit
02521a164c
@ -41,13 +41,9 @@ public:
|
|||||||
{
|
{
|
||||||
m_compilerStack.parse(_code);
|
m_compilerStack.parse(_code);
|
||||||
}
|
}
|
||||||
catch (const std::exception& e)
|
catch(boost::exception const& _e)
|
||||||
{
|
{
|
||||||
std::string const* extra = boost::get_error_info<errinfo_comment>(e);
|
auto msg = std::string("Parsing contract failed with: ") + boost::diagnostic_information(_e);
|
||||||
std::string msg = std::string("Parsing contract failed with: ") +
|
|
||||||
e.what() + std::string("\n");
|
|
||||||
if (extra)
|
|
||||||
msg += *extra;
|
|
||||||
BOOST_FAIL(msg);
|
BOOST_FAIL(msg);
|
||||||
}
|
}
|
||||||
std::string generatedInterfaceString = m_compilerStack.getMetadata("", DocumentationType::ABI_INTERFACE);
|
std::string generatedInterfaceString = m_compilerStack.getMetadata("", DocumentationType::ABI_INTERFACE);
|
||||||
|
@ -45,13 +45,9 @@ public:
|
|||||||
{
|
{
|
||||||
m_compilerStack.parse(_code);
|
m_compilerStack.parse(_code);
|
||||||
}
|
}
|
||||||
catch (const std::exception& e)
|
catch(boost::exception const& _e)
|
||||||
{
|
{
|
||||||
std::string const* extra = boost::get_error_info<errinfo_comment>(e);
|
auto msg = std::string("Parsing contract failed with: ") + boost::diagnostic_information(_e);
|
||||||
std::string msg = std::string("Parsing contract failed with: ") +
|
|
||||||
e.what() + std::string("\n");
|
|
||||||
if (extra)
|
|
||||||
msg += *extra;
|
|
||||||
BOOST_FAIL(msg);
|
BOOST_FAIL(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,13 +50,9 @@ public:
|
|||||||
{
|
{
|
||||||
compiler.compile(_sourceCode, m_optimize);
|
compiler.compile(_sourceCode, m_optimize);
|
||||||
}
|
}
|
||||||
catch (const std::exception& e)
|
catch(boost::exception const& _e)
|
||||||
{
|
{
|
||||||
std::string const* extra = boost::get_error_info<errinfo_comment>(e);
|
auto msg = std::string("Compiling contract failed with: ") + boost::diagnostic_information(_e);
|
||||||
std::string msg = std::string("Parsing contract failed with: ") +
|
|
||||||
e.what() + std::string("\n");
|
|
||||||
if (extra)
|
|
||||||
msg += *extra;
|
|
||||||
BOOST_FAIL(msg);
|
BOOST_FAIL(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user