catch http exception
authorecdsa <ecdsa@github>
Tue, 12 Mar 2013 21:56:58 +0000 (22:56 +0100)
committerecdsa <ecdsa@github>
Tue, 12 Mar 2013 21:56:58 +0000 (22:56 +0100)
gui/exchange_rate.py

index c9cd7a7..cbfa9ca 100644 (file)
@@ -36,7 +36,10 @@ class Exchanger(threading.Thread):
         response = connection.getresponse()
         if response.reason == httplib.responses[httplib.NOT_FOUND]:
             return
-        response = json.loads(response.read())
+        try:
+            response = json.loads(response.read())
+        except:
+            return
         quote_currencies = {}
         try:
             for r in response: