-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve exception error messages for getAddrInfo and getNameInfo #289
Conversation
20b144d
to
8490617
Compare
@develop7 ran into an issue with `yesod devel` (yesodweb/yesod#1471) and got the following error message: ``` devel.hs: Network.Socket.getAddrInfo: does not exist (Name or service not known) ``` It would be useful to have a more detailed error message to aid in debugging this exception. The new message looks like this: ``` > getAddrInfo Nothing (Just "127.0.0.1") (Just "foo") *** Exception: Network.Socket.getAddrInfo (called with preferred socket type/protocol: Nothing, host name: Just "127.0.0.1", service name: Just "foo"): does not exist (nodename nor servname provided, or not known) ``` I think a more verbose error message is well worth it, especially since these kind of lower-level, underlying issues can be hard to debug. (I added a similar error message for `getNameInfo` since it was right there)
8490617
to
368697a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These look great! Thanks.
Thanks @eborden! Didn’t realize you did stackage and network, thanks for all your work :) |
Oh wait I'm confusing you with bergmark, sorry :P |
There's an issue with this PR: the
|
Oh hm, I assumed that correct usage of the library was to set the undefined fields to something sensible first |
I see that the docs for
So it sounds like expected usage is for those fields to be undefined. I can think of a couple workarounds:
I’d probably implement (1) unless you have further advice on this @eborden |
(1) Seems like a reasonable approach. Do you plan to open a PR? |
Yeah, but I’m going skiing for a few days so might be a bit |
@develop7 ran into an issue with
yesod devel
(yesodweb/yesod#1471) and got the following error message:It would be useful to have a more detailed error message to aid in debugging this exception. The new message looks like this:
I think a more verbose error message is well worth it, especially since these kind of lower-level, underlying issues can be hard to debug.
(I added a similar error message for
getNameInfo
since it was right there)