begin/rescue/retry tool
This gem allows you to do dirty stuff without messing up your code base.
I've found myself using begin/rescue/retry through HTTP requests frequently, due timeout or weird stuff caused by a messed up third-party service. (There was a case where a image request was returning empty response randomly, from a external website.)
Code example:
response = Tryout.try { do_http_request }.retry(3, :if => :empty?)
Written by Endel Dreyer
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#