Merge pull request #3497 from joakim-hove/improve-error-msg

Improve error message for invalid phase id
This commit is contained in:
Bård Skaflestad 2021-09-01 21:21:21 +02:00 committed by GitHub
commit 98b74c7b12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,6 +37,7 @@
#include <opm/parser/eclipse/Units/Units.hpp>
#include <cassert>
#include <fmt/format.h>
#include <initializer_list>
#include <iomanip>
#include <sstream>
@ -58,7 +59,7 @@ std::string EclString(Opm::Inplace::Phase phase) {
case Opm::Inplace::Phase::OilResVolume: return "OIPR";
case Opm::Inplace::Phase::GasResVolume: return "GIPR";
case Opm::Inplace::Phase::SALT: return "SIP";
default: throw std::logic_error("Phase not recognized");
default: throw std::logic_error(fmt::format("Phase enum with integer value: {} not recognized", static_cast<int>(phase)));
}
}