diff --git a/src/attributes.jl b/src/attributes.jl index 11a4992482..51aec815fb 100644 --- a/src/attributes.jl +++ b/src/attributes.jl @@ -469,7 +469,12 @@ function submit(model::ModelLike, sub::AbstractSubmittable, args...) ), ) else - throw(UnsupportedSubmittable(sub)) + throw( + UnsupportedSubmittable( + sub, + "submit(::$(typeof(model)), ::$(typeof(sub))) is not supported.", + ), + ) end end diff --git a/test/attributes.jl b/test/attributes.jl index f21a7d4e99..0b87c474eb 100644 --- a/test/attributes.jl +++ b/test/attributes.jl @@ -152,6 +152,18 @@ function test_ConstraintBasisStatus_fallback() ) end +function test_UnsupportedSubmittable() + model = DummyModelWithAdd() + sub = MOI.LazyConstraint{Int}(1) + @test_throws( + MOI.UnsupportedSubmittable( + sub, + "submit(::$(typeof(model)), ::$(typeof(sub))) is not supported.", + ), + MOI.submit(model, sub, 1), + ) +end + function runtests() for name in names(@__MODULE__; all = true) if startswith("$name", "test_")