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

simpleHTTP raises exception on connection refused #92

Open
wahjava opened this issue Nov 16, 2015 · 1 comment
Open

simpleHTTP raises exception on connection refused #92

wahjava opened this issue Nov 16, 2015 · 1 comment

Comments

@wahjava
Copy link

wahjava commented Nov 16, 2015

When nothing listening on localhost:81, with following code:

(simpleHTTP (getRequest "http://localhost:81/")) >>= (\r -> case r of Left _ -> putStrLn "Error"; Right _ -> putStrLn "Alright!")

instead of printing Error, I get:

*** Exception: connect: does not exist (Connection refused)

To me, and as suggested by someone in #haskell, this seems like an unexpected behaviour. I'm expecting error condition to be passed in return value.

Thanks!

@oherrala
Copy link

oherrala commented Jun 5, 2016

With pull request #102 the behaviour changes to:

λ> import Network.HTTP
λ> Network.HTTP.simpleHTTP (getRequest "http://localhost:81")
Left (ErrorMisc "connect: does not exist (Connection refused)")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants