neo4jrb / activegraph

An active model wrapper for the Neo4j Graph Database for Ruby.
http://neo4jrb.io
MIT License
1.39k stars 276 forks source link

ActiveGraph::Core::SchemaErrors::CypherError exceptions unused #1639

Open joshjordan opened 3 years ago

joshjordan commented 3 years ago

When we experience e.g. a constraint validation failure, we're getting Neo4j::Driver::Exceptions::ClientException instead of the expected error class, ActiveGraph::Core::SchemaErrors::ConstraintValidationFailedError.

Upon digging deeper, it appears to me that the ActiveGraph::Core::SchemaErrors::CypherError family of exceptions are completely unused. The API to convert from Neo4j driver errors to ActiveGraph errors is present, but never called. The specs only test the ActiveGraph::Core::SchemaErrors::CypherError API as far as I can see, but not that the conversion ever actually takes place.

joshjordan commented 3 years ago

@klobuczek I may be wrong about my assessment here. Let me know. In any case, I am happy to submit a PR to fix this if you can give me some guidance on where I should fix (base.rb? transaction.rb? transactions.rb?)