Skip to content

Commit aa780cf

Browse files
authored
Merge pull request #575 from neo4j-drivers/python-add-error-mappings
Add error mappings for Python
2 parents eec5f2a + 86dbb30 commit aa780cf

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed
File renamed without changes.

tests/stub/configuration_hints/test_connection_recv_timeout_seconds.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ def _assert_is_tx_terminated_exception(self, e):
7777
"Neo4j::Driver::Exceptions::ClientException",
7878
e.errorType
7979
)
80+
elif driver in ["python"]:
81+
self.assertEqual(
82+
"<class 'neo4j.exceptions.TransactionError'>",
83+
e.errorType
84+
)
8085
else:
8186
self.fail("no error mapping is defined for %s driver" % driver)
8287

tests/stub/tx_run/test_tx_run.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,11 @@ def _assert_is_client_exception(self, e):
447447
"org.neo4j.driver.exceptions.ClientException",
448448
e.exception.errorType
449449
)
450+
elif driver in ["python"]:
451+
self.assertEqual(
452+
"<class 'neo4j.exceptions.ClientError'>",
453+
e.exception.errorType
454+
)
450455
else:
451456
self.fail("no error mapping is defined for %s driver" % driver)
452457

@@ -457,5 +462,10 @@ def _assert_is_tx_terminated_exception(self, e):
457462
"org.neo4j.driver.exceptions.TransactionTerminatedException",
458463
e.exception.errorType
459464
)
465+
elif driver in ["python"]:
466+
self.assertEqual(
467+
"<class 'neo4j.exceptions.TransactionError'>",
468+
e.exception.errorType
469+
)
460470
else:
461471
self.fail("no error mapping is defined for %s driver" % driver)

0 commit comments

Comments
 (0)