catch http exception when wallet is offline
authorecdsa <ecdsa@github>
Mon, 4 Mar 2013 16:20:07 +0000 (17:20 +0100)
committerecdsa <ecdsa@github>
Mon, 4 Mar 2013 16:20:07 +0000 (17:20 +0100)
lib/interface.py

index e9a37c8..83e3c86 100644 (file)
@@ -243,8 +243,11 @@ class Interface(threading.Thread):
         if self.session_id:
             headers['cookie'] = 'SESSION=%s'%self.session_id
 
-        req = urllib2.Request(self.connection_msg, data_json, headers)
-        response_stream = urllib2.urlopen(req, timeout=DEFAULT_TIMEOUT)
+        try:
+            req = urllib2.Request(self.connection_msg, data_json, headers)
+            response_stream = urllib2.urlopen(req, timeout=DEFAULT_TIMEOUT)
+        except:
+            return
 
         for index, cookie in enumerate(cj):
             if cookie.name=='SESSION':