mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[CLI] Report error nicely if writing a file failed
This commit is contained in:
parent
9ebd3da3ff
commit
d115c30dde
@ -5,6 +5,7 @@ Language Features:
|
||||
|
||||
Compiler Features:
|
||||
* Command Line Interface: Report error if file could not be read in ``--standard-json`` mode.
|
||||
* Command Line interface: Report proper error for each output file which could not be written. Previously an exception was thrown, and execution aborted, on the first error.
|
||||
* SMTChecker: Add division by zero checks in the CHC engine.
|
||||
* 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.
|
||||
|
@ -84,8 +84,6 @@ using namespace solidity;
|
||||
using namespace solidity::util;
|
||||
using namespace solidity::langutil;
|
||||
|
||||
DEV_SIMPLE_EXCEPTION(FileError);
|
||||
|
||||
namespace po = boost::program_options;
|
||||
|
||||
namespace solidity::frontend
|
||||
@ -745,7 +743,11 @@ void CommandLineInterface::createFile(string const& _fileName, string const& _da
|
||||
ofstream outFile(pathName);
|
||||
outFile << _data;
|
||||
if (!outFile)
|
||||
BOOST_THROW_EXCEPTION(FileError() << errinfo_comment("Could not write to file: " + pathName));
|
||||
{
|
||||
serr() << "Could not write to file \"" << pathName << "\"." << endl;
|
||||
m_error = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void CommandLineInterface::createJson(string const& _fileName, string const& _json)
|
||||
|
Loading…
Reference in New Issue
Block a user