Skip to content

Commit a0819c2

Browse files
Fix AttributeError when pool is None in Bolt3 error handling (#1267)
Add null check for self.pool before calling on_neo4j_error() in async Bolt3 implementation to prevent AttributeError when the connection pool is not available during Neo4jError handling.
1 parent 4fc39f3 commit a0819c2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/neo4j/_async/io/_bolt3.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,8 @@ async def _process_message(self, tag, fields):
588588
)
589589
raise
590590
except Neo4jError as e:
591-
await self.pool.on_neo4j_error(e, self)
591+
if self.pool:
592+
await self.pool.on_neo4j_error(e, self)
592593
raise
593594
else:
594595
sig_int = ord(summary_signature)

src/neo4j/_sync/io/_bolt3.py

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)