diff --git a/servant-client/src/Servant/Common/Req.hs b/servant-client/src/Servant/Common/Req.hs index 87795831..7c9b5175 100644 --- a/servant-client/src/Servant/Common/Req.hs +++ b/servant-client/src/Servant/Common/Req.hs @@ -21,7 +21,7 @@ import Data.Text.Encoding import Network.HTTP.Client hiding (Proxy, path) import Network.HTTP.Media import Network.HTTP.Types -import qualified Network.HTTP.Types.Header as HTTP +import qualified Network.HTTP.Types.Header as HTTP import Network.URI hiding (path) import Servant.API.ContentTypes import Servant.Client.PerformRequest @@ -108,7 +108,7 @@ performRequest reqMethod req manager reqHost = do , checkStatus = \ _status _headers _cookies -> Nothing } - eResponse <- liftIO $ catchConnectionError $ Client.httpLbs request manager + eResponse <- liftIO $ performHttpRequest manager request case eResponse of Left err -> throwE . ConnectionError $ SomeException err @@ -145,8 +145,3 @@ performRequestNoBody :: Method -> Req -> Manager -> BaseUrl performRequestNoBody reqMethod req manager reqHost = do (_status, _body, _ct, hdrs, _response) <- performRequest reqMethod req manager reqHost return hdrs - -catchConnectionError :: IO a -> IO (Either ServantError a) -catchConnectionError action = - catch (Right <$> action) $ \e -> - pure . Left . ConnectionError $ SomeException (e :: HttpException) diff --git a/servant-client/test/ghcjs/run-tests.sh b/servant-client/test/ghcjs/run-tests.sh index 9068e98d..2e011b39 100755 --- a/servant-client/test/ghcjs/run-tests.sh +++ b/servant-client/test/ghcjs/run-tests.sh @@ -8,4 +8,4 @@ npm install xhr2 export STACK_YAML=stack-ghcjs.yaml stack setup -stack test +stack test --fast