When a neo4j server is down for whatever reason, this module doesn't handle the ECONNREFUSED error- the entire node process exits, which makes it very difficult to return an error to the client. I'm working on a PR for this, but here's what I'm thinking of doing:
Change request callback arity from function(result) { to function(err, result) { This lets us catch ECONNREFUSED errors before they cause node to exit. I'll also have to handle the case where result is null in all functions that make HTTP requests.
When a neo4j server is down for whatever reason, this module doesn't handle the ECONNREFUSED error- the entire node process exits, which makes it very difficult to return an error to the client. I'm working on a PR for this, but here's what I'm thinking of doing:
Change request callback arity from
function(result) {
tofunction(err, result) {
This lets us catch ECONNREFUSED errors before they cause node to exit. I'll also have to handle the case whereresult
is null in all functions that make HTTP requests.