Rethrow the same exception

This commit is contained in:
Joakim Hove 2020-09-17 14:21:06 +02:00
parent 403fd09e69
commit 629da97d61

View File

@ -928,11 +928,9 @@ bool parseState( ParserState& parserState, const Parser& parser ) {
we should not be tempted to continue the parsing.
*/
const auto& location = rawKeyword->location();
std::string msg = "\nFailed to parse keyword: " + rawKeyword->getKeywordName() + "\n" +
"In file " + location.filename + ", line " + std::to_string(location.lineno) + "\n\n" +
"Error message: " + exc.what() + "\n";
throw std::invalid_argument(msg);
std::string msg = Log::fileMessage(location, "Parse error: " + std::string{ exc.what() });
OpmLog::error(msg);
throw;
}
} else {
const std::string msg = "The keyword " + rawKeyword->getKeywordName() + " is not recognized - ignored";