Feature #10129 ยป net-http-error-message.diff
| lib/net/http.rb | ||
|---|---|---|
|
D "opening connection to #{conn_address}:#{conn_port}..."
|
||
|
s = Timeout.timeout(@open_timeout, Net::OpenTimeout) {
|
||
|
TCPSocket.open(conn_address, conn_port, @local_host, @local_port)
|
||
|
begin
|
||
|
TCPSocket.open(conn_address, conn_port, @local_host, @local_port)
|
||
|
rescue => e
|
||
|
raise e, "Failed to open TCP connection to " +
|
||
|
"#{conn_address}:#{conn_port} (#{e.message})"
|
||
|
end
|
||
|
}
|
||
|
s.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
|
||
|
D "opened"
|
||
| test/net/http/test_http.rb | ||
|---|---|---|
|
end
|
||
|
end
|
||
|
def test_failure_message_includes_failed_domain_and_port
|
||
|
begin
|
||
|
Net::HTTP.get(URI.parse("http://doesnotexist.bogus"))
|
||
|
fail "should have raised"
|
||
|
rescue => e
|
||
|
assert_includes e.message, "doesnotexist.bogus:80"
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
module TestNetHTTP_version_1_1_methods
|
||