net-http icon indicating copy to clipboard operation
net-http copied to clipboard

request_get documentation - this method never raises Net::* exceptions

Open leandromoreira opened this issue 4 years ago • 0 comments

Hi there,

While I was reading the request_get documentation I noticed that it states: This method never raises Net::* exceptions. but looking at the code, it seems otherwise.

Also running it on irb does raises the Net::OpenTimeout. Is the doc outdated or am I missing something?

require 'net/http'

client = Net::HTTP.new('www.fakeresponse.com')
client.open_timeout = 1
client.read_timeout = 1
client.write_timeout = 1
client.request_get('/')

leandromoreira avatar Feb 17 '22 15:02 leandromoreira