How to tell if connection good from JavaScript?

Greetings,

I am using Node/JavaScript to access elasticsearch. I am using the 1.4 API.

If a connection fails (using new elasticsearch.Client(...)), the 'new'
succeeds. You don't know the connection failed till you try to use it.
Okay, I can live with that. What I can't live with is the backtrace I get
when I try to use it rather than just an error return.

I get no error when I connect (to the wrong port). But I get the following
when I try to use it:

Elasticsearch ERROR: 2015-01-23T17:14:40Z Error: Request error, retrying --
connect ECONNREFUSED at Log.error
(/home/blake/ComponentServer/node_modules/elasticsearch/src/lib/log.js:213:60)
at checkRespForFailure
(/home/blake/ComponentServer/node_modules/elasticsearch/src/lib/transport.js:195:18)
at HttpConnector.
(/home/blake/ComponentServer/node_modules/elasticsearch/src/lib/connectors/http.js:154:7)
at ClientRequest.bound
(/home/blake/ComponentServer/node_modules/elasticsearch/node_modules/lodash-node/modern/internals/baseBind.js:56:17)
at ClientRequest.emit (events.js:95:17) at Socket.socketErrorListener
(http.js:1552:9) at Socket.emit (events.js:95:17) at net.js:441:14 at
process._tickCallback (node.js:442:13) Elasticsearch WARNING:
2015-01-23T17:14:40Z Unable to revive connection: http://localhost:920/
Elasticsearch WARNING: 2015-01-23T17:14:40Z No living connections error: No
Living connections

I tried using client.cluster.health and client.ping with the same results.

Thanks for the help!

Blake McBride

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/305807ef-2952-4ee9-88e9-653122269b3e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.