diff --git a/src/neo4j/_async/io/_bolt3.py b/src/neo4j/_async/io/_bolt3.py index 773f6e71..a104c623 100644 --- a/src/neo4j/_async/io/_bolt3.py +++ b/src/neo4j/_async/io/_bolt3.py @@ -588,7 +588,8 @@ async def _process_message(self, tag, fields): ) raise except Neo4jError as e: - await self.pool.on_neo4j_error(e, self) + if self.pool: + await self.pool.on_neo4j_error(e, self) raise else: sig_int = ord(summary_signature) diff --git a/src/neo4j/_sync/io/_bolt3.py b/src/neo4j/_sync/io/_bolt3.py index a66f3ead..9e548e3b 100644 --- a/src/neo4j/_sync/io/_bolt3.py +++ b/src/neo4j/_sync/io/_bolt3.py @@ -588,7 +588,8 @@ def _process_message(self, tag, fields): ) raise except Neo4jError as e: - self.pool.on_neo4j_error(e, self) + if self.pool: + self.pool.on_neo4j_error(e, self) raise else: sig_int = ord(summary_signature)