From f8cb0766d4da0c651999a9e6b9b158216b0a47cb Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 21 Mar 2017 11:18:00 +0000 Subject: [PATCH] Add formatFatalError() to StandardCompiler --- libsolidity/interface/StandardCompiler.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libsolidity/interface/StandardCompiler.cpp b/libsolidity/interface/StandardCompiler.cpp index 444ce02e5..e5de39a84 100644 --- a/libsolidity/interface/StandardCompiler.cpp +++ b/libsolidity/interface/StandardCompiler.cpp @@ -29,6 +29,21 @@ using namespace std; using namespace dev; using namespace dev::solidity; +Json::Value formatFatalError(string const& _type, string const& _description) +{ + Json::Value error = Json::objectValue; + error["type"] = _type; + error["component"] = "general"; + error["severity"] = "error"; + error["message"] = _description; + + Json::Value output = Json::objectValue; + output["errors"] = Json::arrayValue; + output["errors"].append(error); + + return output; +} + Json::Value StandardCompiler::compileInternal(Json::Value const& _input) { m_compilerStack.reset(false);