catch exception raised if url is not reachable
authorthomasv <thomasv@gitorious>
Fri, 4 Jan 2013 10:02:39 +0000 (11:02 +0100)
committerthomasv <thomasv@gitorious>
Fri, 4 Jan 2013 10:02:39 +0000 (11:02 +0100)
lib/exchange_rate.py

index a413710..bde5f52 100644 (file)
@@ -28,8 +28,11 @@ class Exchanger(threading.Thread):
         self.discovery()
 
     def discovery(self):
-        connection = httplib.HTTPSConnection('blockchain.info')
-        connection.request("GET", "/ticker")
+        try:
+            connection = httplib.HTTPSConnection('blockchain.info')
+            connection.request("GET", "/ticker")
+        except:
+            return
         response = connection.getresponse()
         if response.reason == httplib.responses[httplib.NOT_FOUND]:
             return