haskell/HTTP

simpleHTTP raises exception on "https"

vlatkoB opened this issue · 2 comments

Hello,

In documentation for simpleHTTP it is not mentioned that it raises IO exception if url is "https" (through failHTTPS).
It should be mentioned in docs, or even better, it should catch it and return Left (maybe ErrorMisc).

Best regards,
vlatko

osa1 commented

👍 for this, undocumented exception throwing is bad. (just got bitten by this)

With pull request #103 the behaviour changes from exception into Left result:

λ> import Network.HTTP
λ> Network.HTTP.simpleHTTP (getRequest "https://haskell.org")
Left (ErrorMisc "user error (https not supported)")