@@ -53,7 +53,7 @@ data ServantError
53 , responseBody :: ByteString
53 , responseBody :: ByteString
55 | ConnectionError
55 | ConnectionError
56− { connectionError :: String
56+ { connectionError :: SomeException
58 deriving (Show, Typeable)
58 deriving (Show, Typeable)
@@ -156,7 +156,7 @@ performRequest reqMethod req isWantedStatus reqHost = do
156 Client.httpLbs request manager
156 Client.httpLbs request manager
157 case eResponse of
157 case eResponse of
158 Left err ->
158 Left err ->
159− left $ ConnectionError (show err)
159+ left . ConnectionError $ SomeException err
161 Right response -> do
161 Right response -> do
162 let status = Client.responseStatus response
162 let status = Client.responseStatus response
@@ -192,4 +192,4 @@ performRequestNoBody reqMethod req wantedStatus reqHost = do
192catchConnectionError :: IO a -> IO (Either ServantError a)
192catchConnectionError :: IO a -> IO (Either ServantError a)
193catchConnectionError action =
193catchConnectionError action =
194 catch (Right <$> action) $ \e ->
194 catch (Right <$> action) $ \e ->
195− pure . Left . ConnectionError . show $ (e :: HttpException)
195+ pure . Left . ConnectionError $ SomeException (e :: HttpException)