From 8e247ca6e8ee6ebf52753e589af221776de6fecf Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Mon, 28 Sep 2020 19:37:07 +0200 Subject: [PATCH] Use new ParseCOntext signature --- python/tests/test_parse_deck.py | 2 +- .../eclipse/EclipseState/SummaryConfig/SummaryConfig.cpp | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/python/tests/test_parse_deck.py b/python/tests/test_parse_deck.py index e889a07dd..372c02894 100644 --- a/python/tests/test_parse_deck.py +++ b/python/tests/test_parse_deck.py @@ -70,7 +70,7 @@ FIPNUM def test_parser_fail_without_extension(self): error_recovery = [("PARSE_RANDOM_SLASH", opm.io.action.ignore)] - with self.assertRaises(ValueError): + with self.assertRaises(RuntimeError): parse_context = ParseContext(error_recovery) deck = Parser().parse_string(self.DECK_ADDITIONAL_KEYWORDS, parse_context) diff --git a/src/opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.cpp b/src/opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.cpp index 0fb65113d..6a37c7efa 100644 --- a/src/opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.cpp +++ b/src/opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.cpp @@ -472,11 +472,9 @@ void keyword_node( SummaryConfig::keyword_list& list, { if (node_names.empty()) { const auto& location = keyword.location(); - const std::string msg = "The network node keyword " + keyword.name() - + " at " + location.filename + ", line " + std::to_string(location.lineno) - + " is not supported in runs without networks"; - - parseContext.handleError( ParseContext::SUMMARY_UNHANDLED_KEYWORD, msg, errors); + std::string msg = "The network node keyword {keyword} is not supported in runs without networks\n" + "In {file} line {line}"; + parseContext.handleError( ParseContext::SUMMARY_UNHANDLED_KEYWORD, msg, location, errors); return; }