diff --git a/lib/OptimizationNLopt/Project.toml b/lib/OptimizationNLopt/Project.toml index e1705c3b0..366644387 100644 --- a/lib/OptimizationNLopt/Project.toml +++ b/lib/OptimizationNLopt/Project.toml @@ -1,7 +1,7 @@ name = "OptimizationNLopt" uuid = "4e6fcdb7-1186-4e1f-a706-475e75c168bb" authors = ["Vaibhav Dixit and contributors"] -version = "0.1.7" +version = "0.1.8" [deps] Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba" diff --git a/lib/OptimizationNLopt/src/OptimizationNLopt.jl b/lib/OptimizationNLopt/src/OptimizationNLopt.jl index 96800ae99..61c909919 100644 --- a/lib/OptimizationNLopt/src/OptimizationNLopt.jl +++ b/lib/OptimizationNLopt/src/OptimizationNLopt.jl @@ -136,7 +136,9 @@ function SciMLBase.__solve(cache::OptimizationCache{ _loss = function (θ) x = cache.f(θ, cache.p) - cache.callback(θ, x...) + if cache.callback(θ, x...) + error("Optimization halted by callback.") + end return x[1] end