ruby icon indicating copy to clipboard operation
ruby copied to clipboard

Update addrinfo error message

Open mperham opened this issue 2 years ago • 4 comments

In English, "nor" is always used with "neither", for example "neither X nor Y". I assume the "neither" got lost somehow; the current error message doesn't make sense without "neither".

mperham avatar Aug 22 '22 21:08 mperham

"or not known" also seems oddly worded. I don't think "not" + "known" typically go together. Maybe "or is unknown"?

jaredcwhite avatar Aug 22 '22 21:08 jaredcwhite

FYI, these messages are probably from the system default of (old) BSD. The macOS man page is still same even in 12.5.

nobu avatar Aug 23 '22 01:08 nobu

This list is only for older platforms where gai_strerror is not available, so it will not be used on many modern systems. I don't think it is worth to change.

nobu avatar Aug 23 '22 01:08 nobu

I agree with @nobu yes this error message is pretty terrible, but that's the one that you will see everywhere, so the one that will give you information if you Google it, etc.

(aside from this change not having an effect on most platforms).

I think a better solution to this would be for the APIs that raise this error (e.g. getaddrinfo) to subclass the exception and provide a better message.

byroot avatar Aug 23 '22 07:08 byroot