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

Catching more requests exceptions

parent 987a1a3f
Branches
Tags
No related merge requests found
......@@ -90,7 +90,7 @@ class Application(object):
wallet_path = os.path.join(config.parameters['home'],
account.name, '__cache__', wallet.pubkey)
if os.path.exists(wallet_path):
json_data = open(wallet_path, 'r')
with open(wallet_path, 'r') as json_data:
data = json.load(json_data)
wallet.load_caches(data)
for community in account.communities:
......
......@@ -35,7 +35,12 @@ class Loader(QObject):
@pyqtSlot()
def load(self):
if self.account_name != "":
try:
self.app.change_current_account(self.app.get_account(self.account_name))
except requests.exceptions.RequestException as e:
QMessageBox.critical(self, ":(",
str(e),
QMessageBox.Ok)
self.loaded.emit()
......@@ -163,7 +168,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
else:
for dead in self.app.current_account.dead_communities:
QMessageBox.critical(self, ":(",
"No {0} peers could be joined. Community was lost.".format(dead),
"No {0} peers could be joined. Connection to its network is lost.".format(dead),
QMessageBox.Ok)
self.action_set_as_default.setEnabled(self.app.current_account.name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment