diff --git a/Changelog.md b/Changelog.md index 9ffaa9a62..b35b712db 100644 --- a/Changelog.md +++ b/Changelog.md @@ -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. diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index 7bb7d3c83..d56a80451 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -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)