neo4j-labs/neo4rs

Unexpected response returned for syntax errors

madchicken opened this issue · 1 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.