Skip to content
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

withMPD raises IOException instead of returning Left (ConnectionError e) #114

Open
crocket opened this issue Oct 29, 2019 · 2 comments
Open

Comments

@crocket
Copy link
Contributor

crocket commented Oct 29, 2019

*** Exception: Network.Socket.connect: <socket: 41>: does not exist (Connection refused)

I think it's supposed to return Left (ConnectionError e) instead of raising an IOException.

For now, I work around the issue with

import System.IO.Error (catchIOError)
import qualified Network.MPD as M

catchIOError (M.withMPD M.status) $ return . Left . M.ConnectionError
@crocket crocket changed the title When mpd server doesn't exist, withMPD raises an exception. withMPD raises an IOException instead of returning Left (ConnectionError e) Oct 29, 2019
@crocket crocket changed the title withMPD raises an IOException instead of returning Left (ConnectionError e) withMPD raises IOException instead of returning Left (ConnectionError e) Oct 30, 2019
@pjones
Copy link

pjones commented May 4, 2020

This happens to me as well. On my machine "localhost" first resolves to ::1 but MPD isn't listening on the IPv6 interface so the connection fails. Other tools (such as ncmpcpp) fall back to 127.0.0.1.

@psibi
Copy link
Collaborator

psibi commented May 5, 2020

Happy to accept MR's for the same.

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

No branches or pull requests

3 participants