Show error window for unhandled exceptions
Use exception hook from main thread for all threads Use signal to delegate error window creation to GUI thread Add more information to issue template Update to PyQt5 Switch from Github to REST-Service Report to web service instead of opening the browser Fix imports Change crashhub URL to electrum.org server Explain that exception hooks are only used in the Qt Gui now
This commit is contained in:
26
lib/util.py
26
lib/util.py
@@ -707,3 +707,29 @@ class QueuePipe:
|
||||
self.send(request)
|
||||
|
||||
|
||||
|
||||
|
||||
def setup_thread_excepthook():
|
||||
"""
|
||||
Workaround for `sys.excepthook` thread bug from:
|
||||
http://bugs.python.org/issue1230540
|
||||
|
||||
Call once from the main thread before creating any threads.
|
||||
"""
|
||||
|
||||
init_original = threading.Thread.__init__
|
||||
|
||||
def init(self, *args, **kwargs):
|
||||
|
||||
init_original(self, *args, **kwargs)
|
||||
run_original = self.run
|
||||
|
||||
def run_with_except_hook(*args2, **kwargs2):
|
||||
try:
|
||||
run_original(*args2, **kwargs2)
|
||||
except Exception:
|
||||
sys.excepthook(*sys.exc_info())
|
||||
|
||||
self.run = run_with_except_hook
|
||||
|
||||
threading.Thread.__init__ = init
|
||||
Reference in New Issue
Block a user