Last Updated: February 25, 2016
·
1.103K
· endel

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?)