Skip to content

Commit f1e7dc1

Browse files
committed
Programmable error class for failures
1 parent 3b7c4b3 commit f1e7dc1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

neo4j/v1/bolt.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ class BoltStatementResult(StatementResult):
193193
""" A handler for the result of Cypher statement execution.
194194
"""
195195

196+
error_class = CypherError
197+
196198
value_system = GraphDatabase.value_systems["packstream"]
197199

198200
zipper = Record
@@ -217,7 +219,7 @@ def on_failure(metadata):
217219
# Called on execution failure.
218220
self._session.connection.acknowledge_failure()
219221
self._session = None
220-
raise CypherError(metadata)
222+
raise self.error_class(metadata)
221223

222224
run_response.on_success = on_header
223225
run_response.on_failure = on_failure

0 commit comments

Comments
 (0)