tcatch some exceptions during GUI init - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit fe1e412f010f410c266c0f73dab64c3ab0488348
DIR parent 6b09d478a5d29dbae5181c61dabcfd7c2efd0bc2
HTML Author: SomberNight <somber.night@protonmail.com>
Date: Thu, 15 Feb 2018 17:30:40 +0100
catch some exceptions during GUI init
Diffstat:
M gui/qt/__init__.py | 12 ++++++++++--
M lib/daemon.py | 8 +++++++-
2 files changed, 17 insertions(+), 3 deletions(-)
---
DIR diff --git a/gui/qt/__init__.py b/gui/qt/__init__.py
t@@ -195,7 +195,8 @@ class ElectrumGui:
wallet = self.daemon.load_wallet(path, None)
except BaseException as e:
traceback.print_exc(file=sys.stdout)
- d = QMessageBox(QMessageBox.Warning, _('Error'), 'Cannot load wallet:\n' + str(e))
+ d = QMessageBox(QMessageBox.Warning, _('Error'),
+ _('Cannot load wallet:') + '\n' + str(e))
d.exec_()
return
if not wallet:
t@@ -212,7 +213,14 @@ class ElectrumGui:
return
wallet.start_threads(self.daemon.network)
self.daemon.add_wallet(wallet)
- w = self.create_window_for_wallet(wallet)
+ try:
+ w = self.create_window_for_wallet(wallet)
+ except BaseException as e:
+ traceback.print_exc(file=sys.stdout)
+ d = QMessageBox(QMessageBox.Warning, _('Error'),
+ _('Cannot create window for wallet:') + '\n' + str(e))
+ d.exec_()
+ return
if uri:
w.pay_to_URI(uri)
w.bring_to_top()
DIR diff --git a/lib/daemon.py b/lib/daemon.py
t@@ -25,6 +25,8 @@
import ast
import os
import time
+import traceback
+import sys
# from jsonrpc import JSONRPCResponseManager
import jsonrpclib
t@@ -300,4 +302,8 @@ class Daemon(DaemonThread):
gui_name = 'qt'
gui = __import__('electrum_gui.' + gui_name, fromlist=['electrum_gui'])
self.gui = gui.ElectrumGui(config, self, plugins)
- self.gui.main()
+ try:
+ self.gui.main()
+ except BaseException as e:
+ traceback.print_exc(file=sys.stdout)
+ # app will exit now