diff --git a/src/model/solve.jl b/src/model/solve.jl index 68ab553..1ff0501 100644 --- a/src/model/solve.jl +++ b/src/model/solve.jl @@ -38,8 +38,7 @@ function solve( JuMP.optimize!(model) if !has_values(model) - @warn "No solution available" - return OrderedDict() + error("No solution available") end if marginal_costs diff --git a/test/model/solve_test.jl b/test/model/solve_test.jl index de31d3c..d3b3d0d 100644 --- a/test/model/solve_test.jl +++ b/test/model/solve_test.jl @@ -38,7 +38,7 @@ end for (location_name, location_dict) in json["products"]["P1"]["initial amounts"] location_dict["amount (tonne)"] *= 1000 end - RELOG.solve(RELOG.parse(json)) + @test_throws ErrorException("No solution available") RELOG.solve(RELOG.parse(json)) end @testset "solve (with storage)" begin