Skip to content

Commit

Permalink
Timer: Don't fail silently when callback fails
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Feb 4, 2021
1 parent ae78269 commit 70d5ca8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion base/asyncevent.jl
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,13 @@ julia> begin
function Timer(cb::Function, timeout::Real; interval::Real=0.0)
timer = Timer(timeout, interval=interval)
t = @task while _trywait(timer)
cb(timer)
try
cb(timer)
catch err
write(stderr, "Error in Timer:\n")
showerror(stderr, err, catch_backtrace())
return
end
isopen(timer) || return
end
lock(timer.cond)
Expand Down

0 comments on commit 70d5ca8

Please sign in to comment.