Improve exception error messages for getAddrInfo and getNameInfo#289
Improve exception error messages for getAddrInfo and getNameInfo#289eborden merged 1 commit intohaskell:masterfrom
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
eborden
left a comment
There was a problem hiding this comment.
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
getNameInfosince it was right there)