Added ParseContext::PARSE_MISSING_INCLUDE

This commit is contained in:
Joakim Hove
2016-06-15 13:43:38 +02:00
parent 0f53084015
commit 10bf441076
5 changed files with 46 additions and 14 deletions

View File

@@ -303,7 +303,9 @@ void ParserState::loadFile(const boost::filesystem::path& inputFile) {
try {
inputFileCanonical = boost::filesystem::canonical(inputFile);
} catch (boost::filesystem::filesystem_error fs_error) {
throw std::runtime_error(std::string("Parser::loadFile fails: ") + fs_error.what());
std::string msg = "Could not open file: " + inputFile.string();
parseContext.handleError( ParseContext::PARSE_MISSING_INCLUDE , deck->getMessageContainer() , msg);
return;
}
const auto closer = []( std::FILE* f ) { std::fclose( f ); };
@@ -314,9 +316,9 @@ void ParserState::loadFile(const boost::filesystem::path& inputFile) {
// make sure the file we'd like to parse is readable
if( !ufp ) {
throw std::runtime_error(std::string("Input file '") +
inputFileCanonical.string() +
std::string("' is not readable"));
std::string msg = "Could not read from file: " + inputFile.string();
parseContext.handleError( ParseContext::PARSE_MISSING_INCLUDE , deck->getMessageContainer() , msg);
return;
}
/*