florinpatrascu / bolt_sips

Neo4j driver for Elixir
Apache License 2.0
256 stars 49 forks source link

Nil error message when sending invalid parameter type on query. #17

Closed vic closed 7 years ago

vic commented 7 years ago

I was doing a Cypher query and unintentionally sent an elixir date-time as parameter for it (instead of actually converting it to an integer timestamp). The issue is, even when the query correctly fails with an error, the message for it is just nil.

{:error, [code: :failure, message: nil]}

It would be a lot nicer if the message was something useful like "we cant serialize that data type to neo4j" or something.

I've added a test for this case here:

https://github.com/florinpatrascu/bolt_sips/compare/master...vic:invalid_param?expand=1

Is the error not being placed by boltex ? or bolt_sips ?

florinpatrascu commented 7 years ago

I see it, it's a %Boltex.PackStream.EncodeError{item: ..., message: nil}, returning the message nil, as you can see the sample above. I'll try to return some details about the error, from my end, when this happen. Thank you, @vic! /cc @mschae

florinpatrascu commented 7 years ago

published https://hex.pm/packages/bolt_sips/0.2.2, with a simple workaround. I'll return the full error (inspect) received from Boltex, until we can bring in the newer version. At least it helps with the debugging, when needed. Thanks again!