diff --git a/opm/common/utility/OpmInputError.hpp b/opm/common/utility/OpmInputError.hpp
index e29c595c6..bbd138aef 100644
--- a/opm/common/utility/OpmInputError.hpp
+++ b/opm/common/utility/OpmInputError.hpp
@@ -16,14 +16,15 @@
You should have received a copy of the GNU General Public License
along with OPM. If not, see .
*/
+#ifndef OPM_ERROR_HPP
+#define OPM_ERROR_HPP
#include
#include
#include
-#ifndef OPM_ERROR_HPP
-#define OPM_ERROR_HPP
+#include
namespace Opm {
@@ -73,10 +74,7 @@ public:
OpmInputError(const std::string& msg_fmt, const KeywordLocation& loc) :
- m_what(fmt::format(msg_fmt,
- fmt::arg("keyword", loc.keyword),
- fmt::arg("file", loc.filename),
- fmt::arg("line", loc.lineno))),
+ m_what(OpmInputError::format(msg_fmt, loc)),
location(loc)
{}
@@ -86,6 +84,14 @@ public:
}
+ static std::string format(const std::string& msg_fmt, const KeywordLocation& loc) {
+ return fmt::format(msg_fmt,
+ fmt::arg("keyword", loc.keyword),
+ fmt::arg("file", loc.filename),
+ fmt::arg("line", loc.lineno));
+ }
+
+
private:
std::string m_what;