philippkueng / node-neo4j

Neo4j REST API wrapper for Node.js
MIT License
211 stars 44 forks source link

Error Message Depth #21

Closed ghost closed 10 years ago

ghost commented 10 years ago

Hey!

Firstly, awesome job on this module.

So before I offer a pull request, wanted to know if you guys would be open to having the error message in the cypherQuery include more detail. Currently, it creates a new Error message and returns the status code "callback(new Error('HTTP Error ' + result.statusCode + ' when running the cypher query against neo4j'), null);" which doesn't tell much. Easily the actual error message can be included. Thoughts?

philippkueng commented 10 years ago

Hi @danieldahan,

Thanks for pointing that out. When I started out with the library the error code for the REST API seemed to be enough, since there were only a few errors that could occur. Though now with the Cypher-Query it indeed makes a lot of sense to extend the error message.

I'd love to get a pull-request for that.

Stofkn commented 10 years ago

Hi I cloned the repo to check it out and add a line but it already includes an extra message no? callback(new Error('HTTP Error ' + result.statusCode + ' when running the cypher query against neo4j.\n' + result.body.message), null);

Can you check if you have the latest version? "version": "2.0.0-beta1" I'm now working on the development branch creating a new method to update nodes, not replacing them.

Greets Kristof

philippkueng commented 10 years ago

@Stofkn thanks a lot for pointing that out.

Note to myself: check the code before responding!!

Stofkn commented 10 years ago

I created an update method and some tests. I'll check it out to make it compatible with RC1 :)


Van: Philipp Küngmailto:notifications@github.com Verzonden: ‎2/‎12/‎2013 8:58 Aan: philippkueng/node-neo4jmailto:node-neo4j@noreply.github.com CC: Kristof Van Miegemmailto:kristofvanmiegem@msn.com Onderwerp: Re: [node-neo4j] Error Message Depth (#21)

@Stofkn thanks a lot for pointing that out.

Note to myself: check the code before responding!!


Reply to this email directly or view it on GitHub: https://github.com/philippkueng/node-neo4j/issues/21#issuecomment-29599997

ghost commented 10 years ago

I don't have that version. I did an npm install to get the library. So awesome that it was updated. I will use the git branch.

Thanks :)

Sent from my iPad

On Dec 2, 2013, at 7:19 AM, Kristof Van Miegem notifications@github.com wrote:

I created an update method and some tests. I'll check it out to make it compatible with RC1 :)


Van: Philipp Küngmailto:notifications@github.com Verzonden: ‎2/‎12/‎2013 8:58 Aan: philippkueng/node-neo4jmailto:node-neo4j@noreply.github.com CC: Kristof Van Miegemmailto:kristofvanmiegem@msn.com Onderwerp: Re: [node-neo4j] Error Message Depth (#21)

@Stofkn thanks a lot for pointing that out.

Note to myself: check the code before responding!!


Reply to this email directly or view it on GitHub: https://github.com/philippkueng/node-neo4j/issues/21#issuecomment-29599997 — Reply to this email directly or view it on GitHub.

Stofkn commented 10 years ago

I added the exception label to the error, so if you make a syntax error in the query or a node is not found than it will be clear if you see the name of the exception + the error message. The development branch now also has an updateNodeById method. We're working on an upgrade to Neo4j 2.0 RC1. So stay tuned! :smile: