mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[CLI] Report error on missing file for --standard-json
This commit is contained in:
1 parent
3c7f642227
commit
9ebd3da3ff
5 files changed
+17
-4
No files matched your search
@@ -84,10 +84,10 @@ using namespace solidity;
|
||||
using namespace solidity::util;
|
||||
using namespace solidity::langutil;
|
||||
|
||||
namespace po = boost::program_options;
|
||||
|
||||
DEV_SIMPLE_EXCEPTION(FileError);
|
||||
|
||||
namespace po = boost::program_options;
|
||||
|
||||
namespace solidity::frontend
|
||||
{
|
||||
|
||||
@@ -1240,8 +1240,17 @@ bool CommandLineInterface::processInput()
|
||||
if (jsonFile.empty())
|
||||
input = readStandardInput();
|
||||
else
|
||||
// TODO: handle FileNotFound exception
|
||||
input = readFileAsString(jsonFile);
|
||||
{
|
||||
try
|
||||
{
|
||||
input = readFileAsString(jsonFile);
|
||||
}
|
||||
catch (FileNotFound const&)
|
||||
{
|
||||
serr() << "File not found: " << jsonFile << endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
StandardCompiler compiler(fileReader);
|
||||
sout() << compiler.compile(std::move(input)) << endl;
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user