From: ThomasV Date: Thu, 28 Jun 2012 06:31:36 +0000 (+0400) Subject: catch exceptions in dispatch thread X-Git-Url: https://git.novaco.in/?p=electrum-server.git;a=commitdiff_plain;h=efc0e63020c5d4e6004064cd2f6dac021d4270fb catch exceptions in dispatch thread --- diff --git a/processor.py b/processor.py index 96fb3c2..5b8ebf2 100644 --- a/processor.py +++ b/processor.py @@ -121,7 +121,11 @@ class RequestDispatcher(threading.Thread): raise TypeError("self.shared not set in Processor") while not self.shared.stopped(): session, request = self.pop_request() - self.do_dispatch(session, request) + try: + self.do_dispatch(session, request) + except: + traceback.print_exc(file=sys.stdout) + self.stop()