diff --git a/WeatherApi.hs b/WeatherApi.hs
--- a/WeatherApi.hs
+++ b/WeatherApi.hs
@@ -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)
 
 
diff --git a/weather-api.cabal b/weather-api.cabal
--- a/weather-api.cabal
+++ b/weather-api.cabal
@@ -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
