mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Catch exceptions of StandardCompiler
This commit is contained in:
@@ -29,7 +29,7 @@ using namespace std;
|
||||
using namespace dev;
|
||||
using namespace dev::solidity;
|
||||
|
||||
Json::Value StandardCompiler::compile(Json::Value const& _input)
|
||||
Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
|
||||
{
|
||||
m_compilerStack.reset(false);
|
||||
|
||||
@@ -139,6 +139,18 @@ Json::Value StandardCompiler::compile(Json::Value const& _input)
|
||||
return output;
|
||||
}
|
||||
|
||||
Json::Value StandardCompiler::compile(Json::Value const& _input)
|
||||
{
|
||||
try
|
||||
{
|
||||
return compileInternal(_input);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
return "{\"errors\":\"[{\"type\":\"InternalCompilerError\",\"component\":\"general\",\"severity\":\"error\",\"message\":\"Internal exception in StandardCompiler::compilerInternal\"}]}";
|
||||
}
|
||||
}
|
||||
|
||||
string StandardCompiler::compile(string const& _input)
|
||||
{
|
||||
Json::Value input;
|
||||
|
||||
Reference in New Issue
Block a user