From 9830947463918605a96ca4a0fc30edccfde5c284 Mon Sep 17 00:00:00 2001
From: Vincent Texier <vit@free.fr>
Date: Sun, 25 Jan 2015 19:44:39 +0100
Subject: [PATCH] Wot view : fix exceptions when network offline

---
 src/cutecoin/gui/wot_tab.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/cutecoin/gui/wot_tab.py b/src/cutecoin/gui/wot_tab.py
index 3b5f4e11..94785709 100644
--- a/src/cutecoin/gui/wot_tab.py
+++ b/src/cutecoin/gui/wot_tab.py
@@ -79,6 +79,10 @@ class WotTabWidget(QWidget, Ui_WotTabWidget):
             self.graphicsView.scene().update_wot(graph)
             return False
 
+        except Exception as e:
+            logging.debug('bma.wot.CertifiersOf request error : ' + str(e))
+            return False
+
         # add wallet node
         node_status = 0
         if public_key == self.account.pubkey:
@@ -197,8 +201,12 @@ class WotTabWidget(QWidget, Ui_WotTabWidget):
 
         if len(text) < 2:
             return False
+        try:
+            response = self.community.request(bma.wot.Lookup, {'search': text})
+        except Exception as e:
+            logging.debug('bma.wot.Lookup request error : ' + str(e))
+            return False
 
-        response = self.community.request(bma.wot.Lookup, {'search': text})
         nodes = {}
         for identity in response['results']:
             nodes[identity['pubkey']] = identity['uids'][0]['uid']
-- 
GitLab