From 604cbef5dc61a30793dc0cb49e064f5c6883c125 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Sun, 25 Oct 2020 19:12:51 +0100 Subject: [PATCH] USe fmt::format() for error message --- src/opm/parser/eclipse/Deck/UDAValue.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/opm/parser/eclipse/Deck/UDAValue.cpp b/src/opm/parser/eclipse/Deck/UDAValue.cpp index 7698a6f3e..961e995bb 100644 --- a/src/opm/parser/eclipse/Deck/UDAValue.cpp +++ b/src/opm/parser/eclipse/Deck/UDAValue.cpp @@ -16,6 +16,8 @@ You should have received a copy of the GNU General Public License along with OPM. If not, see . */ +#include + #include #include @@ -71,8 +73,10 @@ UDAValue UDAValue::serializeObject() void UDAValue::assert_numeric() const { - std::string msg = "Internal error: The support for use of UDQ/UDA is not complete in opm/flow. The string: '" + this->string_value + "' must be numeric"; - this->assert_numeric(msg); + if (!this->numeric_value) { + std::string msg = fmt::format("Internal error: The support for use of UDQ/UDA is not complete in opm/flow. The string: '{}' must be numeric", this->string_value); + this->assert_numeric(msg); + } }