Skip to content

Commit 36888b9

Browse files
author
Dana Powers
committed
Log socket error string with connection errors
1 parent c390f3a commit 36888b9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kafka/conn.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ def connect(self):
374374
elif ret not in (errno.EINPROGRESS, errno.EALREADY, errno.EWOULDBLOCK, 10022):
375375
log.error('Connect attempt to %s returned error %s.'
376376
' Disconnecting.', self, ret)
377-
self.close(Errors.ConnectionError(ret))
377+
errstr = errno.errorcode.get(ret, 'UNKNOWN')
378+
self.close(Errors.ConnectionError('{} {}'.format(ret, errstr)))
378379

379380
# Connection timed out
380381
elif time.time() > request_timeout + self.last_attempt:

0 commit comments

Comments
 (0)