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:
parent
4f3c76364c
commit
418759ece0
@ -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;
|
||||
|
@ -52,6 +52,8 @@ public:
|
||||
std::string compile(std::string const& _input);
|
||||
|
||||
private:
|
||||
Json::Value compileInternal(Json::Value const& _input);
|
||||
|
||||
CompilerStack m_compilerStack;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user