我想使用httparty gem来解决与所有连接错误相关的错误(通过peer,timeout等重置..)
类似的东西:
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