Actions
Backport #2758
closedNoMethodError instead of Errno::ECONNREFUSED when Net::HTTP cannot connect
Status:
Closed
Assignee:
-
Description
=begin
The code:
require net/http.rb
n = Net::HTTP.new('server-that-is-not-listening-on-port-eighty')
n.request_head('/')
Used to throw: "Errno::ECONNREFUSED: Connection refused - connect(2)"
But after http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25851 the code throws: "NoMethodError: undefined method `closed?' for nil:NilClass"
From line 1060 of net/http.rb. It looks like the code was intended to close sockets in the event of an error, but it assumes the socket actually exists.
=end
Updated by shyouhei (Shyouhei Urabe) over 14 years ago
- Status changed from Open to Closed
=begin
This issue was solved with changeset r27955.
John, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end
Actions
Like0
Like0