Skip to content

Conversation

@spl
Copy link
Contributor

@spl spl commented Jan 4, 2017

I ran into the following error in an application:

*** Exception: connect: does not exist (No such file or directory)

It took more time than it should have to (1) trace the error to Network.connectTo which calls Network.Socket.connect and (2) determine that the failure was due to a default use of a Unix socket file that did not exist.

After looking at the error messages in network, I realized that almost none of them included the module name in the location. So, I did a bit of an audit of the error messages. The following error is part of the result, and I find it to be more helpful:

*Network> _ <- connectTo "localhost" (UnixSocket "file-does-not-exist")
*** Exception: Network.Socket.connect: <socket: 11>: does not exist (No such file or directory)

These are the highlights:

  • Add module name where missing
  • Use ioError instead of error and throwIO consistently

* Add module name where missing
* Use ioError instead of error and throwIO consistently
@spl
Copy link
Contributor Author

spl commented Feb 17, 2017

Ping!

@kazu-yamamoto kazu-yamamoto merged commit 7f927c4 into haskell:master Mar 17, 2017
@kazu-yamamoto
Copy link
Collaborator

I'm very sorry for this long delay.
Merged.
Thank you for your contribution.

@spl spl deleted the improve-error-messages branch March 17, 2017 05:00
@spl
Copy link
Contributor Author

spl commented Mar 17, 2017

Thanks! I was getting worried that nobody was maintaining network anymore.

@eborden eborden mentioned this pull request May 16, 2017
eborden added a commit that referenced this pull request May 17, 2017
 * Zero memory of `sockaddr_un` if abstract socket
   [#220](#220)

 * Improving error messages
   [#232](#232)

 * Allow non-blocking file descriptors via `setNonBlockIfNeeded`
   [#242](#242)

 * Update config.{guess,sub} to latest version
   [#244](#244)

 * Rename `my_inet_ntoa` to avoid symbol conflicts
   [#228](#228)

 * Test infrastructure improvements
   [#219](#219)
   [#217](#217)
   [#218](#218)

 * House keeping and cleanup
   [#238](#238)
   [#237](#237)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants