Merge pull request #1933 from joakim-hove/throw-same
Rethrow the same exception
This commit is contained in:
commit
ac40c65f64
@ -928,11 +928,9 @@ bool parseState( ParserState& parserState, const Parser& parser ) {
|
|||||||
we should not be tempted to continue the parsing.
|
we should not be tempted to continue the parsing.
|
||||||
*/
|
*/
|
||||||
const auto& location = rawKeyword->location();
|
const auto& location = rawKeyword->location();
|
||||||
std::string msg = "\nFailed to parse keyword: " + rawKeyword->getKeywordName() + "\n" +
|
std::string msg = Log::fileMessage(location, "Parse error: " + std::string{ exc.what() });
|
||||||
"In file " + location.filename + ", line " + std::to_string(location.lineno) + "\n\n" +
|
OpmLog::error(msg);
|
||||||
"Error message: " + exc.what() + "\n";
|
throw;
|
||||||
|
|
||||||
throw std::invalid_argument(msg);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const std::string msg = "The keyword " + rawKeyword->getKeywordName() + " is not recognized - ignored";
|
const std::string msg = "The keyword " + rawKeyword->getKeywordName() + " is not recognized - ignored";
|
||||||
|
Loading…
Reference in New Issue
Block a user