Issue #10129 has been updated by Nobuyoshi Nakada.

Category set to ext
Status changed from Open to Assigned
Assignee set to Akira Tanaka
Target version set to current: 2.2.0

Shouldn't `Socket` methods raise more descriptive messages?

https://github.com/nobu/ruby/compare/socket-error-message

----------------------------------------
Feature #10129: More descriptive error message for failed net/http requests
https://bugs.ruby-lang.org/issues/10129#change-48333

* Author: Xavier Shay
* Status: Assigned
* Priority: Low
* Assignee: Akira Tanaka
* Category: ext
* Target version: current: 2.2.0
----------------------------------------
Hello,
I would like to propose the following patch:

Before

    2.1.2 :003 > Net::HTTP.get(URI.parse("https://arsrtrtrstsrt.com/arstr"))
    SocketError: getaddrinfo: nodename nor servname provided, or not known

After

    2.1.2 :003 > Net::HTTP.get(URI.parse("https://arsrtrtrstsrt.com/arstr"))
    SocketError: Failed to open TCP connection to arsrtrtrstsrt.com:443 (getaddrinfo: nodename nor servname provided, or not known)

I have an implementation with test at https://github.com/ruby/ruby/pull/700

Thank you for your consideration,
Xavier

---Files--------------------------------
net-http-error-message.diff (1.43 KB)


-- 
https://bugs.ruby-lang.org/