neo4j-labs / neo4rs

Neo4j driver for rust

Home Page:https://docs.rs/neo4rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unexpected response returned for syntax errors

madchicken opened this issue · comments

When executing a Cypher query that contains a syntax error, execute returns an UnuexpectedError that contains a string that is a debug representation of Failure, like:

"unexpected response for RUN: Ok(Failure(Failure { metadata: BoltMap { value: {BoltString { value: "message" }: String(BoltString { value: "Variable `Baz` not defined (line 1, column 49 (offset: 48))\n\"MATCH (Foo: Foo)-[:HAS]->(Bar: Bar) RETURN Foo, Baz\"\n                                                                                                                                                                                                                                                                                                                                                                                                                                                           ^" }), BoltString { value: "code" }: String(BoltString { value: "Neo.ClientError.Statement.SyntaxError" })} } }))"

It would be great to have a dedicated Error for Neo.ClientError.Statement.SyntaxError or get back the BoltMap containing the message key.