Catch ConnectionResetError (fixes #52)

pull/62/head
Konstantin Gründger 2018-09-18 18:35:44 +02:00
rodzic 485282ea3b
commit 84dbfdecdb
2 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -72,8 +72,8 @@ class AprsClient:
break break
callback(packet_str) callback(packet_str)
except BrokenPipeError: except ConnectionError:
self.logger.error('BrokenPipeError', exc_info=True) self.logger.error('ConnectionError', exc_info=True)
except socket.error: except socket.error:
self.logger.error('socket.error', exc_info=True) self.logger.error('socket.error', exc_info=True)
except UnicodeDecodeError: except UnicodeDecodeError:

Wyświetl plik

@ -59,6 +59,8 @@ class AprsClientTest(unittest.TestCase):
'... show must go on', '... show must go on',
BrokenPipeError(), BrokenPipeError(),
'... and on', '... and on',
ConnectionResetError(),
'... and on',
socket.error(), socket.error(),
'... and on', '... and on',
'', '',