packages feed

weather-api 0.4.0 → 0.4.1

raw patch · 2 files changed

+6/−3 lines, 2 files

Files

WeatherApi.hs view
@@ -38,6 +38,8 @@                   ,isHandlerAlive                   ,closeHandler) where +import System.IO.Error+ import Network.HTTP import Network.URI @@ -82,7 +84,8 @@  -- | Retrieve weather using just config -- It's usefull when you don't need one connection for few requests-getWeather' (Config apiHost apiPort queryFun) city =-    openStream apiHost apiPort >>= \s -> queryFun s city+getWeather' (Config apiHost apiPort queryFun) city = do+    catchIOError (openStream apiHost apiPort >>= \s -> queryFun s city)+      (\e -> return $ Left $ NetworkError $ show e)  
weather-api.cabal view
@@ -1,5 +1,5 @@ Name:              weather-api-Version:           0.4.0+Version:           0.4.1 Synopsis:          Weather api implemented in haskell Description:         This library implement generic api for retrieving weather