We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3ccf0c8 + f64109e commit ce9ac47Copy full SHA for ce9ac47
lib/net/http.rb
@@ -1676,7 +1676,9 @@ def connect
1676
begin
1677
s = timeouted_connect(conn_addr, conn_port)
1678
rescue => e
1679
- e = Net::OpenTimeout.new(e) if e.is_a?(Errno::ETIMEDOUT) # for compatibility with previous versions
+ if (defined?(IO::TimeoutError) && e.is_a?(IO::TimeoutError)) || e.is_a?(Errno::ETIMEDOUT) # for compatibility with previous versions
1680
+ e = Net::OpenTimeout.new(e)
1681
+ end
1682
raise e, "Failed to open TCP connection to " +
1683
"#{conn_addr}:#{conn_port} (#{e.message})"
1684
end
0 commit comments