Skip to content

Commit

Permalink
New log msg when solver not found in or-tools (#1687)
Browse files Browse the repository at this point in the history
* New log msg when solver not found in or-tools

* New log msg when solver not found in or-tools : oops, correct an oblivion
  • Loading branch information
guilpier-code authored Oct 6, 2023
1 parent 8c362df commit 3b8c7b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/solver/utils/ortools_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,16 @@ MPSolver* MPSolverFactory(const Antares::Optimization::PROBLEME_SIMPLEXE_NOMME*
solver = MPSolver::CreateSolver((OrtoolsUtils::solverMap.at(solverName)).LPSolverName);

if (!solver)
throw Antares::Data::AssertionError("Solver not found: " + solverName);
{
std::string msg_to_throw = "Solver " + solverName + " not found. \n";
msg_to_throw += "Please make sure that your OR-Tools install supports solver " + solverName + ".";

throw Antares::Data::AssertionError(msg_to_throw);
}
}
catch (...)
{
Antares::logs.error() << "Solver creation failed";
Antares::logs.error() << "Solver creation failed.";
throw;
}

Expand Down
3 changes: 1 addition & 2 deletions src/tests/run-study-tests/test_unfeasible_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,4 @@ def test_unfeasible_problem_01__warning_dry(study_path, check_runner):
checks.add(check = unfeasible_problem(study_path, new_behavior="warning-dry",
checks_on_weeks=warnings_on_weeks,
simulation=check_runner.get_simulation()))
check_runner.run(checks)

check_runner.run(checks)

0 comments on commit 3b8c7b7

Please sign in to comment.