lib/rbbt/util/misc/development.rb in rbbt-util-5.13.37 vs lib/rbbt/util/misc/development.rb in rbbt-util-5.14.0

- old
+ new

@@ -133,27 +133,33 @@ sleep = sleep_array.shift end try = 0 begin yield - rescue Aborted + rescue TryAgain + sleep sleep + retry + rescue Aborted, Interrupt if msg Log.warn("Not Insisting after Aborted: #{$!.message} -- #{msg}") else Log.warn("Not Insisting after Aborted: #{$!.message}") end + raise $! rescue Exception if msg - Log.warn("Insisting after exception: #{$!.message} -- #{msg}") + Log.warn("Insisting after exception: #{$!.class} #{$!.message} -- #{msg}") else - Log.warn("Insisting after exception: #{$!.message}") - end + Log.warn("Insisting after exception: #{$!.class} #{$!.message}") + end + if sleep and try > 0 sleep sleep sleep = sleep_array.shift if sleep_array else Thread.pass end + try += 1 retry if try < times raise $! end end