Adds the SolverError in the lp module. Exceptions raised from the
solver when solve() is called should inherit from this or should
be wrapped as this to allow callers to handle such conditions
gracefully.
In addition, the SolverError is also raised by solve() when a non-optimal solution is found.
This helps avoid a common bug where the result is not checked and
therefore non-optimal solution values are used as though an optimal
solution was found. Instead the solve() now raises a SolverError
when no optimal solution is found. This makes it impossible to
forget to check the solution in the most common case. In cases
when the exception is not desired the new solve_unchecked() can
be used which has the old behavior.
Adds the SolverError in the lp module. Exceptions raised from the solver when solve() is called should inherit from this or should be wrapped as this to allow callers to handle such conditions gracefully.
In addition, the SolverError is also raised by solve() when a non-optimal solution is found. This helps avoid a common bug where the result is not checked and therefore non-optimal solution values are used as though an optimal solution was found. Instead the solve() now raises a SolverError when no optimal solution is found. This makes it impossible to forget to check the solution in the most common case. In cases when the exception is not desired the new solve_unchecked() can be used which has the old behavior.