Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed May 15, 2024
1 parent 23299f1 commit 5911b02
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions src/MOI_wrapper/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1402,10 +1402,19 @@ function _solve_mip_problem(model::Optimizer)
#
# This next bit is _very_ important! See the note associated with
# set_callback.
if model.callback_data.exception isa InterruptException
model.solver_status = GLP_ESTOP
elseif model.callback_data.exception !== nothing
throw(model.callback_data.exception)
if model.callback_data.exception !== nothing
model.callback_data.exception::CapturedException
inner = model.callback_data.exception.ex
if inner isa InterruptException
model.solver_status = GLP_ESTOP
elseif inner isa MOI.InvalidCallbackUsage
# Special-case throwing InvalidCallbackUsage to preserve
# backwards compatibility. But it does mean that they don't have
# good backtraces...
throw(inner)
else
throw(model.callback_data.exception)
end
end
finally
for (column, lower, upper) in bounds_to_reset
Expand Down
2 changes: 1 addition & 1 deletion test/MOI_callbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ function test_no_cache_InterruptException()
return
end

function test_issue_232()
function test_no_cache_issue_232()
model = GLPK.Optimizer()
x = MOI.add_variable(model)
MOI.add_constraint(model, x, MOI.ZeroOne())
Expand Down

0 comments on commit 5911b02

Please sign in to comment.