summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wong <lambda.fairy@gmail.com>2016-10-14 22:42:03 +1300
committerChris Wong <lambda.fairy@gmail.com>2016-10-14 23:07:04 +1300
commitccb004ba10cfcdbcc419440e5f877605896bac4c (patch)
tree1d5a8f8d14061f8bc36c610da9ccd14272a5db04
parent32e34f435c7911f36acdf4a62eec1f56faf0b269 (diff)
downloadhakyll-ccb004ba10cfcdbcc419440e5f877605896bac4c.tar.gz
Update to http-conduit 2.2
The new `parseRequest` function doesn't throw on non-200 responses, so we don't need to account for these in the exception handler.
-rw-r--r--hakyll.cabal2
-rw-r--r--src/Hakyll/Check.hs5
2 files changed, 3 insertions, 4 deletions
diff --git a/hakyll.cabal b/hakyll.cabal
index 44a09e5..c66524e 100644
--- a/hakyll.cabal
+++ b/hakyll.cabal
@@ -202,7 +202,7 @@ Library
If flag(checkExternal)
Build-depends:
- http-conduit >= 2.1 && < 2.2,
+ http-conduit >= 2.2 && < 2.3,
http-types >= 0.7 && < 0.10
Cpp-options:
-DCHECK_EXTERNAL
diff --git a/src/Hakyll/Check.hs b/src/Hakyll/Check.hs
index c917f3a..b41b40e 100644
--- a/src/Hakyll/Check.hs
+++ b/src/Hakyll/Check.hs
@@ -204,7 +204,7 @@ checkExternalUrl url = do
result <- liftIO $ try $ do
mgr <- Http.newManager Http.tlsManagerSettings
runResourceT $ do
- request <- Http.parseUrl urlToCheck
+ request <- Http.parseRequest urlToCheck
response <- Http.http (settings request) mgr
let code = Http.statusCode (Http.responseStatus response)
return $ code >= 200 && code < 300
@@ -236,8 +236,7 @@ checkExternalUrl url = do
-- Convert exception to a concise form
showException e = case cast e of
- Just (Http.StatusCodeException (Http.Status code msg) _ _) ->
- show code ++ " " ++ unpack msg
+ Just (Http.HttpExceptionRequest _ e') -> show e'
_ -> head $ words $ show e
#else
checkExternalUrl _ = return ()