Skip to content

Commit

Permalink
Better exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ufechner7 committed Aug 22, 2024
1 parent 8f87c9e commit 5658735
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/KiteModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,14 @@ function init_sim!(s::AKM; t_end=1.0, stiffness_factor=0.035, delta=0.01, prn=fa
if !found
try
y0, yd0 = KiteModels.find_steady_state!(s; stiffness_factor, delta, prn)
catch
println("ERROR: Failure to find initial steady state in find_steady_state! function!\n"*
"Try to increase the delta parameter or to decrease the inital_stiffness of the init_sim! function.")
return nothing
catch e
if e isa AssertionError
println("ERROR: Failure to find initial steady state in find_steady_state! function!\n"*
"Try to increase the delta parameter or to decrease the inital_stiffness of the init_sim! function.")
return nothing
else
rethrow(e)
end
end
if !mtk
y0 = Vector{SimFloat}(y0)
Expand Down

0 comments on commit 5658735

Please sign in to comment.