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
Post a Comment