Backport #2779

Net::HTTP#get raises NoMethodError

Added by Stephen Sykes almost 2 years ago. Updated 10 months ago.

[ruby-core:28296]
Status:Closed Start date:02/22/2010
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:lib
Target version:-

Description

I think this was introduced in Revision 25851:

require 'net/http'
nh = Net::HTTP.new("does_not_exist_at_all.com")
nh.get("/")
NoMethodError: undefined method `closed?' for nil:NilClass
	from /usr/local/lib/ruby/1.8/net/http.rb:1060:in `request'
	from /usr/local/lib/ruby/1.8/net/http.rb:772:in `get'
	from (irb):11
	from /usr/local/lib/ruby/1.8/net/http.rb:2042

Related issues

duplicates Backport87 - Backport #2758: NoMethodError instead of Errno::ECONNREFUSED when Net::HT... Closed 02/19/2010
duplicates Backport87 - Backport #2708: NoMethodError exception generated when using net/http Closed 02/03/2010

History

Updated by Shyouhei Urabe over 1 year ago

  • Status changed from Open to Closed
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.

Also available in: Atom PDF