Skip to content

Commit

Permalink
Pass exception argument to warn macro
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Aug 13, 2018
1 parent 18fc04d commit b98e2f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/codim1/resolve_point.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ using ..BifurcationsBase: AbstractSpecialPoint, special_points,

function default_resolve_exception_handler(err, interval, warn_exceptions)
if any(isa.(Ref(err), warn_exceptions))
@warn(err)
@warn("""
@warn(
"""
Failed to find bifurcation point within:
$(interval)
""")
""",
exception = err)
return true
end
return false
Expand Down
10 changes: 6 additions & 4 deletions src/continuations/branching.jl
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,12 @@ function new_branches!(cache, opts, sbint::SimpleBifurcationInterval)
# Maybe there is a singularity (around which det(J; tJ)
# flips) within `sbint` and the root finder hits that?
if err isa SingularException
@warn(err)
@warn("""
@warn(
"""
Failed to find bifurcation point within:
$(sbint)
""")
""",
exception = err)
return []
end
rethrow()
Expand Down Expand Up @@ -198,7 +199,8 @@ function check(result::BranchResult, opts)
isapprox(u1, u0; atol=opts.atol, rtol=opts.rtol) ||
isapprox(u2, u0; atol=opts.atol, rtol=opts.rtol)
# throw(BranchError(result, opts))
@warn(BranchError(result, opts))
@warn("Failed to branch.",
exception=BranchError(result, opts))
end
end

Expand Down

0 comments on commit b98e2f9

Please sign in to comment.