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:
parent
3c7f642227
commit
9ebd3da3ff
@ -4,6 +4,7 @@ Language Features:
|
|||||||
* Ability to select the abi coder using ``pragma abicoder v1`` and ``pragma abicoder v2``.
|
* Ability to select the abi coder using ``pragma abicoder v1`` and ``pragma abicoder v2``.
|
||||||
|
|
||||||
Compiler Features:
|
Compiler Features:
|
||||||
|
* Command Line Interface: Report error if file could not be read in ``--standard-json`` mode.
|
||||||
* SMTChecker: Add division by zero checks in the CHC engine.
|
* SMTChecker: Add division by zero checks in the CHC engine.
|
||||||
* SMTChecker: Support ``selector`` for expressions with value known at compile-time.
|
* SMTChecker: Support ``selector`` for expressions with value known at compile-time.
|
||||||
* Command Line Interface: New option ``--model-checker-timeout`` sets a timeout in milliseconds for each individual query performed by the SMTChecker.
|
* Command Line Interface: New option ``--model-checker-timeout`` sets a timeout in milliseconds for each individual query performed by the SMTChecker.
|
||||||
|
@ -84,10 +84,10 @@ using namespace solidity;
|
|||||||
using namespace solidity::util;
|
using namespace solidity::util;
|
||||||
using namespace solidity::langutil;
|
using namespace solidity::langutil;
|
||||||
|
|
||||||
namespace po = boost::program_options;
|
|
||||||
|
|
||||||
DEV_SIMPLE_EXCEPTION(FileError);
|
DEV_SIMPLE_EXCEPTION(FileError);
|
||||||
|
|
||||||
|
namespace po = boost::program_options;
|
||||||
|
|
||||||
namespace solidity::frontend
|
namespace solidity::frontend
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -1240,8 +1240,17 @@ bool CommandLineInterface::processInput()
|
|||||||
if (jsonFile.empty())
|
if (jsonFile.empty())
|
||||||
input = readStandardInput();
|
input = readStandardInput();
|
||||||
else
|
else
|
||||||
// TODO: handle FileNotFound exception
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
input = readFileAsString(jsonFile);
|
input = readFileAsString(jsonFile);
|
||||||
|
}
|
||||||
|
catch (FileNotFound const&)
|
||||||
|
{
|
||||||
|
serr() << "File not found: " << jsonFile << endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
StandardCompiler compiler(fileReader);
|
StandardCompiler compiler(fileReader);
|
||||||
sout() << compiler.compile(std::move(input)) << endl;
|
sout() << compiler.compile(std::move(input)) << endl;
|
||||||
return true;
|
return true;
|
||||||
|
1
test/cmdlineTests/standard_file_not_found/args
Normal file
1
test/cmdlineTests/standard_file_not_found/args
Normal file
@ -0,0 +1 @@
|
|||||||
|
--standard-json
|
1
test/cmdlineTests/standard_file_not_found/err
Normal file
1
test/cmdlineTests/standard_file_not_found/err
Normal file
@ -0,0 +1 @@
|
|||||||
|
File not found: standard_file_not_found/input.sol
|
1
test/cmdlineTests/standard_file_not_found/exit
Normal file
1
test/cmdlineTests/standard_file_not_found/exit
Normal file
@ -0,0 +1 @@
|
|||||||
|
1
|
Loading…
Reference in New Issue
Block a user