From 0238f4533913f37c30ac3bf8a9852c73cdcc1744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Wed, 27 Nov 2024 08:52:05 +0100 Subject: [PATCH] Use formattedErrors() and simplify. No longer calling dump() means we avoid the extra dumping to stderr of the warnings and errors. --- opm/simulators/utils/readDeck.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/opm/simulators/utils/readDeck.cpp b/opm/simulators/utils/readDeck.cpp index 772e79223..0ce1da3de 100644 --- a/opm/simulators/utils/readDeck.cpp +++ b/opm/simulators/utils/readDeck.cpp @@ -617,10 +617,7 @@ void Opm::readDeck(Opm::Parallel::Communication comm, if (*errorGuard) { // errors encountered parseSuccess = 0; - if (failureMessage.size()) { - failureMessage += std::string("\n"); - } - failureMessage += errorGuard->dump(); + failureMessage += errorGuard->formattedErrors(); errorGuard->clear(); } @@ -628,7 +625,7 @@ void Opm::readDeck(Opm::Parallel::Communication comm, if (! parseSuccess) { if (comm.rank() == 0) { - OpmLog::error(fmt::format("Unrecoverable errors while loading input: {}", failureMessage)); + OpmLog::error(fmt::format("Unrecoverable errors while loading input:\n{}", failureMessage)); } #if HAVE_MPI