diff --git a/src/solver/modeler/ortoolsImpl/linearProblem.cpp b/src/solver/modeler/ortoolsImpl/linearProblem.cpp index ff4fd0c654..cd3b8dd510 100644 --- a/src/solver/modeler/ortoolsImpl/linearProblem.cpp +++ b/src/solver/modeler/ortoolsImpl/linearProblem.cpp @@ -37,12 +37,12 @@ OrtoolsLinearProblem::OrtoolsLinearProblem(bool isMip, const std::string& solver objective_ = mpSolver_->MutableObjective(); } -class ElemAlreadyExists: public std::exception +class ElemAlreadyExists: public std::runtime_error { public: - const char* what() const noexcept override + explicit ElemAlreadyExists(): + std::runtime_error("Element name already exists in linear problem") { - return "Element name already exists in linear problem"; } };