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

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -