From c73e77b3de16cd95414bea6d8f34b62cf0840d5e Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Thu, 11 Nov 2021 10:24:10 +0100 Subject: [PATCH] Use OpmInputError for restart input problems --- src/opm/parser/eclipse/EclipseState/EclipseState.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/opm/parser/eclipse/EclipseState/EclipseState.cpp b/src/opm/parser/eclipse/EclipseState/EclipseState.cpp index e48f2d55d..84a98cfb2 100644 --- a/src/opm/parser/eclipse/EclipseState/EclipseState.cpp +++ b/src/opm/parser/eclipse/EclipseState/EclipseState.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -154,16 +155,17 @@ AquiferConfig load_aquifers(const Deck& deck, const TableManager& tables, NNC& i const auto& init_config = this->getInitConfig(); if (init_config.restartRequested()) { + const auto& restart_keyword = deck.getKeyword(); const auto& io_config = this->getIOConfig(); const int report_step = init_config.getRestartStep(); const auto& restart_file = io_config.getRestartFileName( init_config.getRestartRootName(), report_step, false); if (!std::filesystem::exists(restart_file)) - throw std::logic_error(fmt::format("The restart file: {} does not exist", restart_file)); + throw OpmInputError(fmt::format("The restart file: {} does not exist", restart_file), restart_keyword.location()); if (io_config.getUNIFIN()) { EclIO::ERst rst{restart_file}; if (!rst.hasReportStepNumber(report_step)) - throw std::logic_error(fmt::format("Report step: {} not found in restart file: {}", report_step, restart_file)); + throw OpmInputError(fmt::format("Report step: {} not found in restart file: {}", report_step, restart_file), restart_keyword.location()); } } }