Skip to content

Commit

Permalink
replace throw with error
Browse files Browse the repository at this point in the history
  • Loading branch information
Ickaser committed Dec 9, 2024
1 parent 5fa3032 commit cf9403d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/OrdinaryDiffEqCore/src/initialize_dae.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function _initialize_dae!(integrator, prob::ODEProblem,
_initialize_dae!(integrator, prob,
OverrideInit(integrator.opts.abstol), x)
elseif !isdefined(Main, :OrdinaryDiffEqNonlinearSolve)
throw("`OrdinaryDiffEqNonlinearSolve` is not loaded, which is required for the default initialization algorithm (`BrownFullBasicInit` or `ShampineCollocationInit`). To solve this problem, either do `using OrdinaryDiffEqNonlinearSolve` or pass `initializealg = CheckInit()` to the `solve` function. This second option requires consistent `u0`.")
error("`OrdinaryDiffEqNonlinearSolve` is not loaded, which is required for the default initialization algorithm (`BrownFullBasicInit` or `ShampineCollocationInit`). To solve this problem, either do `using OrdinaryDiffEqNonlinearSolve` or pass `initializealg = CheckInit()` to the `solve` function. This second option requires consistent `u0`.")
else
_initialize_dae!(integrator, prob,
BrownFullBasicInit(integrator.opts.abstol), x)
Expand All @@ -64,7 +64,7 @@ function _initialize_dae!(integrator, prob::DAEProblem,
_initialize_dae!(integrator, prob,
OverrideInit(integrator.opts.abstol), x)
elseif !isdefined(Main, :OrdinaryDiffEqNonlinearSolve)
throw("`OrdinaryDiffEqNonlinearSolve` is not loaded, which is required for the default initialization algorithm (`BrownFullBasicInit` or `ShampineCollocationInit`). To solve this problem, either do `using OrdinaryDiffEqNonlinearSolve` or pass `initializealg = CheckInit()` to the `solve` function. This second option requires consistent `u0`.")
error("`OrdinaryDiffEqNonlinearSolve` is not loaded, which is required for the default initialization algorithm (`BrownFullBasicInit` or `ShampineCollocationInit`). To solve this problem, either do `using OrdinaryDiffEqNonlinearSolve` or pass `initializealg = CheckInit()` to the `solve` function. This second option requires consistent `u0`.")
elseif prob.differential_vars === nothing
_initialize_dae!(integrator, prob,
ShampineCollocationInit(), x)
Expand Down

0 comments on commit cf9403d

Please sign in to comment.