Skip to content

Commit deec96a

Browse files
authored
Merge pull request #797 from JuliaOpt/bl/submit_values
Allow arbitrary number of arguments to submit
2 parents 47f281f + 9f15e1b commit deec96a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/attributes.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,9 @@ end
377377

378378
"""
379379
submit(optimizer::AbstractOptimizer, sub::AbstractSubmittable,
380-
value)::Nothing
380+
values...)::Nothing
381381
382-
Submit `value` to the submittable `sub` of the optimizer `optimizer`.
382+
Submit `values` to the submittable `sub` of the optimizer `optimizer`.
383383
384384
An [`UnsupportedSubmittable`](@ref) error is thrown if `model` does not support
385385
the attribute `attr` (see [`supports`](@ref)) and a [`SubmitNotAllowed`](@ref)
@@ -388,7 +388,8 @@ error is thrown if it supports the submittable `sub` but it cannot be submitted.
388388
function submit end
389389
function submit(model::ModelLike, sub::AbstractSubmittable, args...)
390390
if supports(model, sub)
391-
throw(SubmitNotAllowed(sub))
391+
throw(ArgumentError(
392+
"Submitting $(typeof.(args)) for `$(typeof(sub))` is not valid."))
392393
else
393394
throw(UnsupportedSubmittable(sub))
394395
end

0 commit comments

Comments
 (0)