Repository navigation
Add getaddrinfo and getnameinfo returning GaiError - #657
kazu-yamamoto wants to merge 7 commits into
Conversation
1a2289c to
db8dd8d
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vdukhovni
left a comment
There was a problem hiding this comment.
LGTM.
Possible tweak in the error message, if preferred.
| , ", service name: " | ||
| , maybe "Nothing" show service | ||
| , ")" | ||
| ] |
There was a problem hiding this comment.
If those Nothing strings are distracting placeholders, rather the deliberate detail, one could write:
message = case catMaybes [
("preferred socket type/protocol: " ++) . show <$> hints
, (", host name: " ++) . show <$> node
, (", service name: " ++) . show <$> service
] of
[] -> "Network.Socket.getAddrInfo"
xs -> "Network.Socket.getAddrInfo (called with" ++ fold xs ++ ")"
| , ", socket address: " | ||
| , show addr | ||
| , ")" | ||
| ] |
There was a problem hiding this comment.
Same here, unless the Nothing placeholders are preferred to eliding these when not specified.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
c2acd4c to
69baf37
Compare
|
Thanks for the review, and no worries about the timing. I took the suggestion for When no argument is given, the message is just "Network.Socket.getAddrInfo".
|
For #635. A draft while the naming is discussed there.
GaiErroris abstract: theEAI_*patterns,EAI_SYSTEMcarrying itsErrno, andgaiErrorCode. A code an OS lacks (only Windows lacks any:EAI_ADDRFAMILY,EAI_OVERFLOW,EAI_SYSTEM) gets its own value that no OS returns.gaiErrorStringis pure: an English table (glibc's wording), the errno description forEAI_SYSTEM, and the Winsock table for unknown codes on Windows.getaddrinfoandgetnameinfo(withNameInfoQuery) returnEither GaiError. errno is read right after the call.getAddrInfoandgetNameInfoare built on them, and change in three ways:EAI_SYSTEMis thrown from its errno (ioe_errnoand the errno'sIOErrorType), not asNoSuchThing"System error".EAI_AGAINisResourceExhausted, asEAGAINis.Tested locally on Linux, macOS and Windows (WinIO).
🤖 Generated with Claude Code