Add an 'exception' attribute to Connection objects recording the reason for termination of the networking thread.

This commit is contained in:
Joseph Crowe 2015-10-05 03:14:48 +01:00
parent 626b765094
commit f1391ab29b

View File

@ -149,7 +149,6 @@ class Connection(object):
self.write_packet(handshake)
class NetworkingThread(threading.Thread):
interrupt = False
@ -160,6 +159,12 @@ class NetworkingThread(threading.Thread):
self.daemon = True
def run(self):
try:
self._run()
except Exception as e:
self.connection.exception = e
def _run(self):
while True:
if self.interrupt:
break