mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
solc: Add a top-level exception handler
This commit is contained in:
parent
e544a20460
commit
7db95a7430
@ -53,22 +53,28 @@ static void setDefaultOrCLocale()
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
setDefaultOrCLocale();
|
||||
solidity::frontend::CommandLineInterface cli;
|
||||
if (!cli.parseArguments(argc, argv))
|
||||
return 1;
|
||||
if (!cli.processInput())
|
||||
return 1;
|
||||
bool success = false;
|
||||
try
|
||||
{
|
||||
success = cli.actOnInput();
|
||||
}
|
||||
catch (boost::exception const& _exception)
|
||||
{
|
||||
cerr << "Exception during output generation: " << boost::diagnostic_information(_exception) << endl;
|
||||
success = false;
|
||||
}
|
||||
setDefaultOrCLocale();
|
||||
solidity::frontend::CommandLineInterface cli;
|
||||
if (!cli.parseArguments(argc, argv) || !cli.processInput() || !cli.actOnInput())
|
||||
return 1;
|
||||
|
||||
return success ? 0 : 1;
|
||||
return 0;
|
||||
}
|
||||
catch (boost::exception const& exception)
|
||||
{
|
||||
cerr << "Uncaught exception: " << boost::diagnostic_information(exception) << endl;
|
||||
return 1;
|
||||
}
|
||||
catch (std::exception const& exception)
|
||||
{
|
||||
cerr << "Uncaught exception" << (exception.what() ? ": " + string(exception.what()) : ".") << endl;
|
||||
return 1;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
cerr << "Uncaught exception. No message provided." << endl;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user