Skip to content

Commit

Permalink
Update to http-conduit 2.2
Browse files Browse the repository at this point in the history
The new `parseRequest` function doesn't throw on non-200 responses, so
we don't need to account for these in the exception handler.
  • Loading branch information
lambda-fairy committed Oct 14, 2016
1 parent 32e34f4 commit ccb004b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion hakyll.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/Hakyll/Check.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ()
Expand Down

0 comments on commit ccb004b

Please sign in to comment.