Browse files

Avoid http-conduit exceptions from non-2XX codes and timeouts

--HG--
extra : amend_source : 7b271d420264cf51b77bf5514dc9b366e5481889
  • Loading branch information...
1 parent a675833 commit e3a0f789801237b5abdd7b2c65d15b47d00d0b98 @meteficha meteficha committed Jan 5, 2013
Showing with 5 additions and 2 deletions.
  1. +4 −1 lib/Network/HTTP/LoadTest.hs
  2. +1 −1 pronk.cabal
View
5 lib/Network/HTTP/LoadTest.hs
@@ -67,8 +67,11 @@ client Config{..} mgr interval = loop 0 []
liftIO . threadDelay . truncate $ (interval - elapsed) * 1000000
loop (n+1) (s:acc)
issueRequest :: ResourceT IO (Response L.ByteString)
- issueRequest = httpLbs (fromReq request) mgr
+ issueRequest = httpLbs (clear $ fromReq request) mgr
`catch` (throwIO . NetworkError)
+ where clear r = r { checkStatus = \_ _ -> Nothing
+ , responseTimeout = Nothing
+ }
timedRequest :: ResourceT IO Event
timedRequest
| timeout == 0 = respEvent <$> issueRequest
View
2 pronk.cabal
@@ -58,7 +58,7 @@ library
ghc-prim >= 0.2.0.0,
hashable >= 1.2.0.2,
hastache,
- http-conduit >= 1.6,
+ http-conduit >= 1.7,
http-types,
lifted-base,
meldable-heap,

0 comments on commit e3a0f78

Please sign in to comment.