Skip to content

Commit 3aba8c0

Browse files
committed
Log failed attempts of opening a connection
Backport of #608
1 parent 2e161bd commit 3aba8c0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

neo4j/io/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,8 @@ def connect(address, *, timeout, custom_resolver, ssl_context, keep_alive):
13171317
s = _secure(s, resolved_address.host_name, ssl_context)
13181318
return _handshake(s, resolved_address)
13191319
except (BoltError, DriverError, OSError) as error:
1320+
local_port = s.getsockname()[1] if s else 0
1321+
log.debug("[#%04X] C: <CONNECTION FAILED> %r", local_port, error)
13201322
if s:
13211323
_close_socket(s)
13221324
errors.append(error)

0 commit comments

Comments
 (0)