Improve error message for invalid phase id

This commit is contained in:
Joakim Hove 2021-09-01 14:26:56 +02:00
parent fcdb4c33ea
commit 7cb0bb5ae6

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)));
}
}