Skip to content
Snippets Groups Projects
Commit c3373447 authored by inso's avatar inso
Browse files

Handle some 404 errors with new communities

parent 4b45a318
No related branches found
No related tags found
No related merge requests found
...@@ -303,7 +303,7 @@ class Node(QObject): ...@@ -303,7 +303,7 @@ class Node(QObject):
block_data['number'])) block_data['number']))
self.changed.emit() self.changed.emit()
except ValueError as e: except ValueError as e:
if '404' in e: if '404' in str(e):
self.set_block(None) self.set_block(None)
logging.debug("Error in block reply") logging.debug("Error in block reply")
self.changed.emit() self.changed.emit()
......
...@@ -81,6 +81,19 @@ class CommunityTile(QFrame): ...@@ -81,6 +81,19 @@ class CommunityTile(QFrame):
</html>""".format(currency=self.community.currency, </html>""".format(currency=self.community.currency,
message=self.tr("Not connected")) message=self.tr("Not connected"))
self.text_label.setText(description) self.text_label.setText(description)
except ValueError as e:
if '404' in str(e):
description = """<html>
<body>
<p>
<span style=" font-size:16pt; font-weight:600;">{currency}</span>
</p>
<p>{message}</p>
</body>
</html>""".format(currency=self.community.currency,
message=self.tr("Community not initialized"))
self.text_label.setText(description)
self.busy.hide() self.busy.hide()
def mousePressEvent(self, event): def mousePressEvent(self, event):
......
...@@ -192,6 +192,9 @@ class CommunityWidget(QWidget, Ui_CommunityWidget): ...@@ -192,6 +192,9 @@ class CommunityWidget(QWidget, Ui_CommunityWidget):
except NoPeerAvailable as e: except NoPeerAvailable as e:
logging.debug(str(e)) logging.debug(str(e))
text += " ( ### ) " text += " ( ### ) "
except NoPeerAvailable as e:
logging.debug(str(e))
if len(self.community.network.synced_nodes) == 0: if len(self.community.network.synced_nodes) == 0:
self.button_membership.setEnabled(False) self.button_membership.setEnabled(False)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment