ruby on rails - HTTParty gem how to rescue errors -


i rescue errors related connection errors using httpparty gem (reset peer,timeout, etc..)

something like:

  begin   response = httparty.get('http://somewhere.url', http_proxyaddr: proxy_addr,http_proxyport: proxy_port, timeout: 10)   rescue httparty::error => e     puts 'httparty::error '+ e.message     retry           rescue standarderror => e    puts 'standarderror '+ e.message   end 


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -