mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #2164 from ethereum/jsonio-catch-internal-exceptions
JSON IO catch internal exceptions
This commit is contained in:
commit
c3b839ca75
@ -181,6 +181,10 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
|
||||
for (auto const& sourceName: sources.getMemberNames())
|
||||
{
|
||||
string hash;
|
||||
|
||||
if (!sources[sourceName].isObject())
|
||||
return formatFatalError("JSONError", "Source input is not a JSON object.");
|
||||
|
||||
if (sources[sourceName]["keccak256"].isString())
|
||||
hash = sources[sourceName]["keccak256"].asString();
|
||||
|
||||
@ -454,6 +458,14 @@ Json::Value StandardCompiler::compile(Json::Value const& _input)
|
||||
{
|
||||
return compileInternal(_input);
|
||||
}
|
||||
catch (Json::LogicError const& _exception)
|
||||
{
|
||||
return formatFatalError("InternalCompilerError", string("JSON logic exception: ") + _exception.what());
|
||||
}
|
||||
catch (Json::RuntimeError const& _exception)
|
||||
{
|
||||
return formatFatalError("InternalCompilerError", string("JSON runtime exception: ") + _exception.what());
|
||||
}
|
||||
catch (Exception const& _exception)
|
||||
{
|
||||
return formatFatalError("InternalCompilerError", "Internal exception in StandardCompiler::compileInternal: " + boost::diagnostic_information(_exception));
|
||||
|
Loading…
Reference in New Issue
Block a user