Catch more exceptions, resolves: #5, #6, #8

This commit is contained in:
TheKysek 2016-10-16 13:01:41 +02:00
parent 0e8f8bd85e
commit 3fd0334fbe

View File

@ -129,7 +129,7 @@ class Connection(threading.Thread):
self.buffer_send = self.buffer_send[amount:] self.buffer_send = self.buffer_send[amount:]
except (BlockingIOError, ssl.SSLWantWriteError): except (BlockingIOError, ssl.SSLWantWriteError):
pass pass
except BrokenPipeError as e: except (BrokenPipeError, ConnectionResetError, ssl.SSLError) as e:
logging.debug('Disconnecting from {}:{}. Reason: {}'.format(self.host, self.port, e)) logging.debug('Disconnecting from {}:{}. Reason: {}'.format(self.host, self.port, e))
self.status = 'disconnecting' self.status = 'disconnecting'