From 9cc633dcb04d401b8884612b00cc9a1bd075cf56 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Wed, 29 Jul 2026 13:56:28 +1200 Subject: [PATCH 1/4] Improve error messages of various errors --- src/Bridges/lazy_bridge_optimizer.jl | 20 +++++++++- src/attributes.jl | 48 ++++++++++++++++------ src/constraints.jl | 60 +++++++++++++++++++--------- src/indextypes.jl | 7 +++- test/General/test_attributes.jl | 9 ++++- test/General/test_errors.jl | 47 +++++++++++++--------- 6 files changed, 137 insertions(+), 54 deletions(-) diff --git a/src/Bridges/lazy_bridge_optimizer.jl b/src/Bridges/lazy_bridge_optimizer.jl index 7d0d97f050..8823451864 100644 --- a/src/Bridges/lazy_bridge_optimizer.jl +++ b/src/Bridges/lazy_bridge_optimizer.jl @@ -544,6 +544,22 @@ function is_variable_bridged(b::LazyBridgeOptimizer, S::Type{<:MOI.AbstractSet}) return is_bridged(b, S) && is_variable_edge_best(b.graph, node(b, S)) end +function MOI.UnsupportedConstraint{F,S}( + model::LazyBridgeOptimizer, +) where {F<:MOI.AbstractFunction,S<:MOI.AbstractSet} + msg = """ + ## More information + + Bridges are enabled, but there are none that can rewrite the \ + constraint into a form supported by the solver. + + The model that we were unable to add the constraint to is: + + $(sprint(show, model)) + """ + return MOI.UnsupportedConstraint{F,S}(msg) +end + function bridge_type(b::LazyBridgeOptimizer, S::Type{<:MOI.AbstractSet}) bt = get(b.cached_bridge_type, (S,), nothing) if bt !== nothing @@ -552,7 +568,7 @@ function bridge_type(b::LazyBridgeOptimizer, S::Type{<:MOI.AbstractSet}) index = bridge_index(b, S) if iszero(index) F = MOI.Utilities.variable_function_type(S) - throw(MOI.UnsupportedConstraint{F,S}()) + throw(MOI.UnsupportedConstraint{F,S}(b)) end new_bt = Variable.concrete_bridge_type(b.variable_bridge_types[index], S) b.cached_bridge_type[(S,)] = new_bt @@ -570,7 +586,7 @@ function bridge_type( end index = bridge_index(b, F, S) if iszero(index) - throw(MOI.UnsupportedConstraint{F,S}()) + throw(MOI.UnsupportedConstraint{F,S}(b)) end new_bt = Constraint.concrete_bridge_type(b.constraint_bridge_types[index], F, S) diff --git a/src/attributes.jl b/src/attributes.jl index f671e3d86f..efaeca0c8b 100644 --- a/src/attributes.jl +++ b/src/attributes.jl @@ -243,8 +243,11 @@ end function Base.showerror(io::IO, err::ResultIndexBoundsError) return print( io, - "Result index of attribute $(err.attr) out of bounds. There are " * - "currently $(err.result_count) solution(s) in the model.", + """ + Result index of attribute $(err.attr) is out of bounds. + + There are currently $(err.result_count) solution(s) in the model. + """, ) end @@ -285,8 +288,11 @@ end function Base.showerror(io::IO, err::ConflictIndexBoundsError) return print( io, - "Conflict index of attribute $(err.attr) out of bounds. There are " * - "currently $(err.conflict_count) conflict(s) in the model.", + """ + Conflict index of attribute $(err.attr) is out of bounds. + + There are currently $(err.conflict_count) conflict(s) in the model. + """, ) end @@ -1261,9 +1267,13 @@ end function Base.showerror(io::IO, err::OptimizeInProgress) return print( io, - typeof(err), - ": Cannot get result as the `MOI.optimize!` has not", - " finished.", + """ + Unable to get the attribute $(err.attr) because `MOI.optimize!` in progress. + + This error occurs when you try to query an unsupported attribute from \ + inside a callback. Consult the solver's documentation to learn which \ + attributes may be queried inside a callback. + """ ) end @@ -2633,8 +2643,15 @@ struct FunctionTypeMismatch{F1,F2} <: Exception end function Base.showerror(io::IO, err::FunctionTypeMismatch{F1,F2}) where {F1,F2} return print( io, - """$(typeof(err)): Cannot modify functions of different types. - Constraint type is $F1 while the replacement function is of type $F2.""", + """ + Cannot modify functions of different types. + + The original function is a $F1 + + The replacement function is a $F2 + + When modifying the `ConstraintFunction` the types must be the same. + """, ) end @@ -2714,9 +2731,16 @@ struct SetTypeMismatch{S1,S2} <: Exception end function Base.showerror(io::IO, err::SetTypeMismatch{S1,S2}) where {S1,S2} return print( io, - """$(typeof(err)): Cannot modify sets of different types. Constraint - type is $S1 while the replacement set is of type $S2. Use `transform` - instead.""", + """ + Cannot modify sets of different types. + + The original set is a $S1 + + The replacement set is a $S2 + + When modifying the `ConstraintSet` the types must be the same. + Alternatively, you may have meant to call `MOI.transform` instead. + """, ) end diff --git a/src/constraints.jl b/src/constraints.jl index bba3a5a01a..dfc17a6218 100644 --- a/src/constraints.jl +++ b/src/constraints.jl @@ -35,35 +35,45 @@ the model, that is, that [`supports_constraint`](@ref) returns `false`. ```jldoctest julia> showerror(stdout, MOI.UnsupportedConstraint{MOI.VariableIndex,MOI.ZeroOne}()) -UnsupportedConstraint: `MathOptInterface.VariableIndex`-in-`MathOptInterface.ZeroOne` constraints are not supported by the -solver you have chosen, and we could not reformulate your model into a -form that is supported. +UnsupportedConstraint{ + MathOptInterface.VariableIndex, + MathOptInterface.ZeroOne, +} -To fix this error you must choose a different solver. +This constraint type is not supported by the solver. +To fix this error you must choose a different solver. ``` """ struct UnsupportedConstraint{F<:AbstractFunction,S<:AbstractSet} <: UnsupportedError # Human-friendly explanation why the attribute cannot be set message::String -end -UnsupportedConstraint{F,S}() where {F,S} = UnsupportedConstraint{F,S}("") + function UnsupportedConstraint{F,S}( + msg::String = "", + ) where {F<:AbstractFunction,S<:AbstractSet} + return new{F,S}(msg) + end +end function Base.showerror(io::IO, err::UnsupportedConstraint{F,S}) where {F,S} print( io, """ - UnsupportedConstraint: `$F`-in-`$S` constraints are not supported by the - solver you have chosen, and we could not reformulate your model into a - form that is supported. + UnsupportedConstraint{ + $F, + $S, + } - To fix this error you must choose a different solver. + This constraint type is not supported by the solver. - $(err.message) + To fix this error you must choose a different solver. """, ) + if !isempty(err.message) + print(io, "\n", err.message) + end return end @@ -289,10 +299,16 @@ end function Base.showerror(io::IO, err::LowerBoundAlreadySet{S1,S2}) where {S1,S2} return print( io, - typeof(err), - ": Cannot add `VariableIndex`-in-`$(S2)` constraint for variable ", - "$(err.vi) as a `VariableIndex`-in-`$(S1)` constraint was already ", - "set for this variable and both constraints set a lower bound.", + """ + LowerBoundAlreadySet{ + $S1, + $S2, + } + + You cannot add a `VariableIndex`-in-`$(S2)` constraint for variable \ + "$(err.vi) because a `VariableIndex`-in-`$(S1)` constraint was already \ + set for this variable and both constraints define a lower bound. + """, ) end @@ -311,10 +327,16 @@ end function Base.showerror(io::IO, err::UpperBoundAlreadySet{S1,S2}) where {S1,S2} return print( io, - typeof(err), - ": Cannot add `VariableIndex`-in-`$(S2)` constraint for variable ", - "$(err.vi) as a `VariableIndex`-in-`$(S1)` constraint was already ", - "set for this variable and both constraints set an upper bound.", + """ + UpperBoundAlreadySet{ + $S1, + $S2, + } + + You cannot add a `VariableIndex`-in-`$(S2)` constraint for variable \ + "$(err.vi) because a `VariableIndex`-in-`$(S1)` constraint was already \ + set for this variable and both constraints define an upper bound. + """, ) end diff --git a/src/indextypes.jl b/src/indextypes.jl index 4fa471dbab..6568c91772 100644 --- a/src/indextypes.jl +++ b/src/indextypes.jl @@ -94,7 +94,12 @@ end function Base.showerror(io::IO, err::InvalidIndex) return print( io, - "The index $(err.index) is invalid. Note that an index becomes invalid after it has been deleted.", + """ + The index $(err.index) is invalid. + + An index becomes invalid after it has been deleted. Alternatively, this \ + error might mean that you have re-used the index from a different model. + """, ) end diff --git a/test/General/test_attributes.jl b/test/General/test_attributes.jl index 68e6685df7..b7420ca723 100644 --- a/test/General/test_attributes.jl +++ b/test/General/test_attributes.jl @@ -393,7 +393,14 @@ end function test_showerror_OptimizeInProgress() err = MOI.OptimizeInProgress(MOI.VariablePrimal()) @test sprint(showerror, err) == - "$(typeof(err)): Cannot get result as the `MOI.optimize!` has not finished." + """ + Unable to get the attribute MathOptInterface.VariablePrimal(1) \ + because `MOI.optimize!` in progress. + + This error occurs when you try to query an unsupported attribute from \ + inside a callback. Consult the solver's documentation to learn which \ + attributes may be queried inside a callback. + """ return end diff --git a/test/General/test_errors.jl b/test/General/test_errors.jl index 2f3da89a08..e7a599c6cf 100644 --- a/test/General/test_errors.jl +++ b/test/General/test_errors.jl @@ -67,13 +67,14 @@ function test_errors_UnsupportedConstraint() MOI.add_constraint(model, vi, MOI.EqualTo(0)), ) msg = """ - UnsupportedConstraint: `$(MOI.VariableIndex)`-in-`$(MOI.EqualTo{Int})` constraints are not supported by the - solver you have chosen, and we could not reformulate your model into a - form that is supported. - - To fix this error you must choose a different solver. + UnsupportedConstraint{ + $(MOI.VariableIndex), + $(MOI.EqualTo{Int}), + } + This constraint type is not supported by the solver. + To fix this error you must choose a different solver. """ try MOI.add_constraint(model, vi, MOI.EqualTo(0)) @@ -297,22 +298,25 @@ function test_errors_show_SetAttributeNotAllowed() end function test_errors_ResultIndexBoundsError() - @test sprint( - showerror, - MOI.ResultIndexBoundsError(MOI.VariablePrimal(1), 0), - ) == - "Result index of attribute MathOptInterface.VariablePrimal(1) out of" * - " bounds. There are currently 0 solution(s) in the model." + err = MOI.ResultIndexBoundsError(MOI.VariablePrimal(1), 0) + @test sprint(showerror, err) == + """ + Result index of attribute MathOptInterface.VariablePrimal(1) is out of bounds. + + There are currently 0 solution(s) in the model. + """ + return end function test_errors_ConflictIndexBoundsError() - @test sprint( - showerror, - MOI.ConflictIndexBoundsError(MOI.ConstraintConflictStatus(1), 0), - ) == - "Conflict index of attribute " * - "MathOptInterface.ConstraintConflictStatus(1) out of bounds. " * - "There are currently 0 conflict(s) in the model." + err = MOI.ConflictIndexBoundsError(MOI.ConstraintConflictStatus(1), 0) + @test sprint(showerror, err) == + """ + Conflict index of attribute MathOptInterface.ConstraintConflictStatus(1) is out of bounds. + + There are currently 0 conflict(s) in the model. + """ + return end function test_errors_InvalidCalbackUsage() @@ -393,7 +397,12 @@ end function test_showerror_InvalidIndex() x = MOI.VariableIndex(1) @test sprint(showerror, MOI.InvalidIndex(x)) == - "The index $x is invalid. Note that an index becomes invalid after it has been deleted." + """ + The index $x is invalid. + + An index becomes invalid after it has been deleted. Alternatively, this \ + error might mean that you have re-used the index from a different model. + """ return end From 42dab1fb1f378bb180e2516b569bf0a51eac7e71 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Wed, 29 Jul 2026 14:07:43 +1200 Subject: [PATCH 2/4] Update --- src/constraints.jl | 4 ++-- test/General/test_constraints.jl | 26 ++++++++++++++++++++------ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/constraints.jl b/src/constraints.jl index dfc17a6218..6f32342995 100644 --- a/src/constraints.jl +++ b/src/constraints.jl @@ -306,7 +306,7 @@ function Base.showerror(io::IO, err::LowerBoundAlreadySet{S1,S2}) where {S1,S2} } You cannot add a `VariableIndex`-in-`$(S2)` constraint for variable \ - "$(err.vi) because a `VariableIndex`-in-`$(S1)` constraint was already \ + $(err.vi) because a `VariableIndex`-in-`$(S1)` constraint was already \ set for this variable and both constraints define a lower bound. """, ) @@ -334,7 +334,7 @@ function Base.showerror(io::IO, err::UpperBoundAlreadySet{S1,S2}) where {S1,S2} } You cannot add a `VariableIndex`-in-`$(S2)` constraint for variable \ - "$(err.vi) because a `VariableIndex`-in-`$(S1)` constraint was already \ + $(err.vi) because a `VariableIndex`-in-`$(S1)` constraint was already \ set for this variable and both constraints define an upper bound. """, ) diff --git a/test/General/test_constraints.jl b/test/General/test_constraints.jl index 50baa5e5d8..686a8e9b39 100644 --- a/test/General/test_constraints.jl +++ b/test/General/test_constraints.jl @@ -47,9 +47,16 @@ function test_LowerBoundAlreadySet_error() err = MOI.LowerBoundAlreadySet{S1,S2}(x) @test err isa Exception @test sprint(showerror, err) == - "$(typeof(err)): Cannot add `VariableIndex`-in-`$(S2)` constraint " * - "for variable $(x) as a `VariableIndex`-in-`$(S1)` constraint was " * - "already set for this variable and both constraints set a lower bound." + """ + LowerBoundAlreadySet{ + $S1, + $S2, + } + + You cannot add a `VariableIndex`-in-`$(S2)` constraint for variable \ + $(x) because a `VariableIndex`-in-`$(S1)` constraint was already set \ + for this variable and both constraints define a lower bound. + """ return end @@ -60,9 +67,16 @@ function test_UpperBoundAlreadySet_error() err = MOI.UpperBoundAlreadySet{S1,S2}(x) @test err isa Exception @test sprint(showerror, err) == - "$(typeof(err)): Cannot add `VariableIndex`-in-`$(S2)` constraint " * - "for variable $(x) as a `VariableIndex`-in-`$(S1)` constraint was " * - "already set for this variable and both constraints set an upper bound." + """ + UpperBoundAlreadySet{ + $S1, + $S2, + } + + You cannot add a `VariableIndex`-in-`$(S2)` constraint for variable \ + $(x) because a `VariableIndex`-in-`$(S1)` constraint was already set \ + for this variable and both constraints define an upper bound. + """ return end From 9a9e8742d806ad7c0b1b848dc03357cf7a5e982a Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Wed, 29 Jul 2026 14:32:01 +1200 Subject: [PATCH 3/4] Update --- src/attributes.jl | 2 +- .../General/test_lazy_bridge_optimizer.jl | 29 +++++++------- test/General/test_attributes.jl | 18 ++++----- test/General/test_constraints.jl | 40 +++++++++---------- test/General/test_errors.jl | 36 ++++++++--------- 5 files changed, 63 insertions(+), 62 deletions(-) diff --git a/src/attributes.jl b/src/attributes.jl index efaeca0c8b..b88d6258dc 100644 --- a/src/attributes.jl +++ b/src/attributes.jl @@ -1273,7 +1273,7 @@ function Base.showerror(io::IO, err::OptimizeInProgress) This error occurs when you try to query an unsupported attribute from \ inside a callback. Consult the solver's documentation to learn which \ attributes may be queried inside a callback. - """ + """, ) end diff --git a/test/Bridges/General/test_lazy_bridge_optimizer.jl b/test/Bridges/General/test_lazy_bridge_optimizer.jl index bae95797b9..fcd65517b5 100644 --- a/test/Bridges/General/test_lazy_bridge_optimizer.jl +++ b/test/Bridges/General/test_lazy_bridge_optimizer.jl @@ -1772,17 +1772,18 @@ function test_UnsupportedConstraint_when_it_cannot_be_bridged() mock = MOI.Utilities.MockOptimizer(NoRSOCModel{Float64}()) bridged_mock = MOI.Bridges.LazyBridgeOptimizer(mock) x = MOI.add_variables(bridged_mock, 4) - err = MOI.UnsupportedConstraint{ - MOI.VectorOfVariables, - MOI.RotatedSecondOrderCone, - }() - @test_throws err begin + @test_throws( + MOI.UnsupportedConstraint{ + MOI.VectorOfVariables, + MOI.RotatedSecondOrderCone, + }, MOI.add_constraint( bridged_mock, MOI.VectorOfVariables(x), MOI.RotatedSecondOrderCone(4), - ) - end + ), + ) + return end function test_MOI_runtests_No_RSOCModel() @@ -1839,17 +1840,17 @@ function test_bridge_selection() MOI.LogDetConeTriangle, )) x = MOI.add_variables(bridged_mock, 3) - err = MOI.UnsupportedConstraint{ - MOI.VectorAffineFunction{Float64}, - MOI.LogDetConeTriangle, - }() - @test_throws err begin + @test_throws( + MOI.UnsupportedConstraint{ + MOI.VectorAffineFunction{Float64}, + MOI.LogDetConeTriangle, + }, MOI.Bridges.bridge_type( bridged_mock, MOI.VectorAffineFunction{Float64}, MOI.LogDetConeTriangle, - ) - end + ), + ) c = MOI.add_constraint( bridged_mock, MOI.VectorOfVariables(x), diff --git a/test/General/test_attributes.jl b/test/General/test_attributes.jl index b7420ca723..6c6cdc740b 100644 --- a/test/General/test_attributes.jl +++ b/test/General/test_attributes.jl @@ -392,15 +392,15 @@ end function test_showerror_OptimizeInProgress() err = MOI.OptimizeInProgress(MOI.VariablePrimal()) - @test sprint(showerror, err) == - """ - Unable to get the attribute MathOptInterface.VariablePrimal(1) \ - because `MOI.optimize!` in progress. - - This error occurs when you try to query an unsupported attribute from \ - inside a callback. Consult the solver's documentation to learn which \ - attributes may be queried inside a callback. - """ + ret = """ + Unable to get the attribute MathOptInterface.VariablePrimal(1) \ + because `MOI.optimize!` in progress. + + This error occurs when you try to query an unsupported attribute from \ + inside a callback. Consult the solver's documentation to learn which \ + attributes may be queried inside a callback. + """ + @test sprint(showerror, err) == ret return end diff --git a/test/General/test_constraints.jl b/test/General/test_constraints.jl index 686a8e9b39..ac0e72743a 100644 --- a/test/General/test_constraints.jl +++ b/test/General/test_constraints.jl @@ -46,17 +46,17 @@ function test_LowerBoundAlreadySet_error() S2 = MOI.Interval{Int} err = MOI.LowerBoundAlreadySet{S1,S2}(x) @test err isa Exception - @test sprint(showerror, err) == - """ - LowerBoundAlreadySet{ - $S1, - $S2, - } + ret = """ + LowerBoundAlreadySet{ + $S1, + $S2, + } - You cannot add a `VariableIndex`-in-`$(S2)` constraint for variable \ - $(x) because a `VariableIndex`-in-`$(S1)` constraint was already set \ - for this variable and both constraints define a lower bound. - """ + You cannot add a `VariableIndex`-in-`$(S2)` constraint for variable \ + $(x) because a `VariableIndex`-in-`$(S1)` constraint was already set \ + for this variable and both constraints define a lower bound. + """ + @test sprint(showerror, err) == ret return end @@ -66,17 +66,17 @@ function test_UpperBoundAlreadySet_error() S2 = MOI.Interval{Int} err = MOI.UpperBoundAlreadySet{S1,S2}(x) @test err isa Exception - @test sprint(showerror, err) == - """ - UpperBoundAlreadySet{ - $S1, - $S2, - } + ret = """ + UpperBoundAlreadySet{ + $S1, + $S2, + } - You cannot add a `VariableIndex`-in-`$(S2)` constraint for variable \ - $(x) because a `VariableIndex`-in-`$(S1)` constraint was already set \ - for this variable and both constraints define an upper bound. - """ + You cannot add a `VariableIndex`-in-`$(S2)` constraint for variable \ + $(x) because a `VariableIndex`-in-`$(S1)` constraint was already set \ + for this variable and both constraints define an upper bound. + """ + @test sprint(showerror, err) == ret return end diff --git a/test/General/test_errors.jl b/test/General/test_errors.jl index e7a599c6cf..0f518eef9b 100644 --- a/test/General/test_errors.jl +++ b/test/General/test_errors.jl @@ -66,7 +66,7 @@ function test_errors_UnsupportedConstraint() MOI.UnsupportedConstraint, MOI.add_constraint(model, vi, MOI.EqualTo(0)), ) - msg = """ + ret = """ UnsupportedConstraint{ $(MOI.VariableIndex), $(MOI.EqualTo{Int}), @@ -79,7 +79,7 @@ function test_errors_UnsupportedConstraint() try MOI.add_constraint(model, vi, MOI.EqualTo(0)) catch err - @test sprint(showerror, err) == msg + @test sprint(showerror, err) == ret end return end @@ -299,23 +299,23 @@ end function test_errors_ResultIndexBoundsError() err = MOI.ResultIndexBoundsError(MOI.VariablePrimal(1), 0) - @test sprint(showerror, err) == - """ - Result index of attribute MathOptInterface.VariablePrimal(1) is out of bounds. + ret = """ + Result index of attribute MathOptInterface.VariablePrimal(1) is out of bounds. - There are currently 0 solution(s) in the model. - """ + There are currently 0 solution(s) in the model. + """ + @test sprint(showerror, err) == ret return end function test_errors_ConflictIndexBoundsError() err = MOI.ConflictIndexBoundsError(MOI.ConstraintConflictStatus(1), 0) - @test sprint(showerror, err) == - """ - Conflict index of attribute MathOptInterface.ConstraintConflictStatus(1) is out of bounds. + ret = """ + Conflict index of attribute MathOptInterface.ConstraintConflictStatus(1) is out of bounds. - There are currently 0 conflict(s) in the model. - """ + There are currently 0 conflict(s) in the model. + """ + @test sprint(showerror, err) == ret return end @@ -396,13 +396,13 @@ end function test_showerror_InvalidIndex() x = MOI.VariableIndex(1) - @test sprint(showerror, MOI.InvalidIndex(x)) == - """ - The index $x is invalid. + err = """ + The index $x is invalid. - An index becomes invalid after it has been deleted. Alternatively, this \ - error might mean that you have re-used the index from a different model. - """ + An index becomes invalid after it has been deleted. Alternatively, this \ + error might mean that you have re-used the index from a different model. + """ + @test sprint(showerror, MOI.InvalidIndex(x)) == err return end From 323cac5a926ccce71081fd4598065cce0c35a987 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Wed, 29 Jul 2026 15:27:46 +1200 Subject: [PATCH 4/4] Update --- .../General/test_lazy_bridge_optimizer.jl | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/test/Bridges/General/test_lazy_bridge_optimizer.jl b/test/Bridges/General/test_lazy_bridge_optimizer.jl index fcd65517b5..2e73b72c6f 100644 --- a/test/Bridges/General/test_lazy_bridge_optimizer.jl +++ b/test/Bridges/General/test_lazy_bridge_optimizer.jl @@ -2704,6 +2704,47 @@ function test_custom_cost_model_bridge_selection() return end +struct _UnsupportedSet <: MOI.AbstractScalarSet end + +function test_bridge_unsupported_constraint() + model = MOI.instantiate( + MOI.Utilities.Model{Float64}; + with_bridge_type = Float64, + ) + x = MOI.add_variable(model) + err = MOI.UnsupportedConstraint{MOI.VariableIndex,_UnsupportedSet}(model) + @test_throws err MOI.add_constraint(model, x, _UnsupportedSet()) + @test_throws err MOI.add_constrained_variable(model, _UnsupportedSet()) + ret = """ + UnsupportedConstraint{ + MathOptInterface.VariableIndex, + $_UnsupportedSet, + } + + This constraint type is not supported by the solver. + + To fix this error you must choose a different solver. + + ## More information + + Bridges are enabled, but there are none that can rewrite the constraint into a form supported by the solver. + + The model that we were unable to add the constraint to is: + + MOIB.LazyBridgeOptimizer{MOIU.Model{Float64}} + ├ Variable bridges: none + ├ Constraint bridges: none + ├ Objective bridges: none + └ model: MOIU.Model{Float64} + ├ ObjectiveSense: FEASIBILITY_SENSE + ├ ObjectiveFunctionType: MOI.ScalarAffineFunction{Float64} + ├ NumberOfVariables: 1 + └ NumberOfConstraints: 0 + """ + @test sprint(showerror, err) == ret + return +end + end # module TestBridgesLazyBridgeOptimizer.runtests()