ruby
ruby copied to clipboard
Update addrinfo error message
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".
"or not known" also seems oddly worded. I don't think "not" + "known" typically go together. Maybe "or is unknown"?
FYI, these messages are probably from the system default of (old) BSD. The macOS man page is still same even in 12.5.
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.
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.