From 28ca561bba004e4f24b45ba3e680802678581986 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Thu, 4 Jul 2019 18:06:21 +0200 Subject: [PATCH] added trigger_crash method for testing crash reporter invoke via console as: electrum.base_crash_reporter.trigger_crash() --- electrum/base_crash_reporter.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/electrum/base_crash_reporter.py b/electrum/base_crash_reporter.py index b6d02d881..212a71411 100644 --- a/electrum/base_crash_reporter.py +++ b/electrum/base_crash_reporter.py @@ -131,3 +131,20 @@ def get_user_description(self): def get_wallet_type(self): raise NotImplementedError + + +def trigger_crash(): + # note: do not change the type of the exception, the message, + # or the name of this method. All reports generated through this + # method will be grouped together by the crash reporter, and thus + # don't spam the issue tracker. + + class TestingException(Exception): + pass + + def crash_test(): + raise TestingException("triggered crash for testing purposes") + + import threading + t = threading.Thread(target=crash_test) + t.start()