Less verbose connection error reporting

- don't print tracebacks on normal (timeout/reset) errors
master
Peter Šurda 6 years ago
parent cff1af1b4f
commit d8301ff512
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

@ -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)

Loading…
Cancel
Save