Less verbose connection error reporting

- don't print tracebacks on normal (timeout/reset) errors
This commit is contained in:
Peter Šurda 2017-02-26 20:29:07 +01:00
parent cff1af1b4f
commit d8301ff512
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -96,7 +96,8 @@ class sendDataThread(threading.Thread):
select.select([], [self.sslSock], [], 10)
logger.debug('sock.recv retriable SSL error')
continue
raise
logger.debug('Connection error (SSL)')
return False
except socket.error as e:
if e.errno in (errno.EAGAIN, errno.EWOULDBLOCK) or \
(sys.platform.startswith('win') and \
@ -104,8 +105,8 @@ class sendDataThread(threading.Thread):
select.select([], [self.sslSock if isSSL else self.sock], [], 10)
logger.debug('sock.recv retriable error')
continue
if e.errno == errno.EPIPE:
logger.debug('Connection broken')
if e.errno in (errno.EPIPE, errno.ECONNRESET):
logger.debug('Connection error (EPIPE/ECONNRESET)')
return False
raise
throttle.SendThrottle().wait(amountSent)