Exception Handling in Ruby - call begin if it goes to rescue -
i have simple exception handling block
begin <connect network , make request> rescue <comes here if didnt connect / whatever other error> end
i want modify such if comes rescue - goes begin again. give 5 tries . if still not connecting - come out of block
you want keyword retry
. couple max_retries. i.e. if (max_retries -= 1) > 0
retry
Comments
Post a Comment