mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Catch errors gracefully in CLI assembler
This commit is contained in:
parent
c09f071ff6
commit
a95c86e8e4
@ -984,6 +984,8 @@ bool CommandLineInterface::assemble()
|
|||||||
bool successful = true;
|
bool successful = true;
|
||||||
map<string, shared_ptr<Scanner>> scanners;
|
map<string, shared_ptr<Scanner>> scanners;
|
||||||
for (auto const& src: m_sourceCodes)
|
for (auto const& src: m_sourceCodes)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
auto scanner = make_shared<Scanner>(CharStream(src.second), src.first);
|
auto scanner = make_shared<Scanner>(CharStream(src.second), src.first);
|
||||||
scanners[src.first] = scanner;
|
scanners[src.first] = scanner;
|
||||||
@ -993,6 +995,17 @@ bool CommandLineInterface::assemble()
|
|||||||
//@TODO we should not just throw away the result here
|
//@TODO we should not just throw away the result here
|
||||||
m_assemblyStacks[src.first].assemble();
|
m_assemblyStacks[src.first].assemble();
|
||||||
}
|
}
|
||||||
|
catch (Exception const& _exception)
|
||||||
|
{
|
||||||
|
cerr << "Exception in assembler: " << boost::diagnostic_information(_exception) << endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
cerr << "Unknown exception in assembler." << endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
for (auto const& stack: m_assemblyStacks)
|
for (auto const& stack: m_assemblyStacks)
|
||||||
{
|
{
|
||||||
for (auto const& error: stack.second.errors())
|
for (auto const& error: stack.second.errors())
|
||||||
|
Loading…
Reference in New Issue
Block a user