Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

import for py2neo.error.CypherExecutionException

I'm expectedly getting a CypherExecutionException. I would like to catch it but I can't seem to find the import for it.

Where is it? How do I find it myself next time?

like image 299
Tony Ennis Avatar asked Dec 29 '25 02:12

Tony Ennis


1 Answers

Depending on which version of py2neo you're using, and which Cypher endpoint - legacy or transactional - this may be one of the auto-generated errors built dynamically from the server response. Newer functionality (i.e. the transaction endpoint) no longer does this and instead holds hard-coded definitions for all exceptions for just this reason. This wasn't possible for the legacy endpoint when the full list of possible exceptions was undocumented.

You should however be able to catch py2neo.error.GraphError instead which is the base class from which these dynamic errors inherit. You can then study the attributes of that error for more specific checking.

like image 117
Nigel Small Avatar answered Dec 30 '25 16:12

Nigel Small



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!