From 6caebad3290255d48130b3a60cf2f9eb2f249684 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Tue, 21 Jun 2022 16:32:35 +0200 Subject: [PATCH] Use OpmInputError instead of std::logic_error. Message now becomes: ``` Error: Problem with keyword MULTIREG In /path/to/file.inc line 3 region operation on 3D field MULTZ with global storage is not implemented! ``` --- src/opm/input/eclipse/EclipseState/Grid/FieldProps.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/opm/input/eclipse/EclipseState/Grid/FieldProps.cpp b/src/opm/input/eclipse/EclipseState/Grid/FieldProps.cpp index 25870cb3b..cf1b5f50a 100644 --- a/src/opm/input/eclipse/EclipseState/Grid/FieldProps.cpp +++ b/src/opm/input/eclipse/EclipseState/Grid/FieldProps.cpp @@ -936,8 +936,11 @@ void FieldProps::handle_region_operation(const DeckKeyword& keyword) { if (field_data.global_data) { const auto& location = keyword.location(); - throw std::logic_error(fmt::format("In file {} line {}: {} region operation on 3D field {} with global storage is not implemented!", - location.filename, std::to_string(location.lineno), keyword.name(), target_kw)); + using namespace std::string_literals; + throw OpmInputError(fmt::format("region operation on 3D field {} with "s + + "global storage is not implemented!"s, + target_kw), + location); } FieldProps::apply(fromString(keyword.name()), field_data.data, field_data.value_status, scalar_value, index_list);