fullscale / elastic.js

A JavaScript implementation of the elasticsearch Query DSL
http://docs.fullscale.co/elasticjs/
MIT License
654 stars 163 forks source link

Question : How can we get exception when we can't connect to ES Serv #32

Closed cmoulliard closed 10 years ago

cmoulliard commented 11 years ago

Hi,

If the ES server is not responding, then the following exception appears in the javscript console log : "Failed to load resource" Is there a way to get this info from ejs.Request() ?

Regards,

Charles

porjo commented 11 years ago

I was wondering the same thing.

When my ES server is down I get this error in my console log: SyntaxError: JSON.parse: unexpected end of data @ http://code.jquery.com/jquery-1.9.1.min.js:3

I'm passing an error callback to Request.doSearch() and I'm also catching Ajax errors with Jquery ajaxError(), however neither of these get called in this instance.

svperfecta commented 11 years ago

I just ran into the same error. Essentially, if the server goes offline after I've already setup my client, no error gets thrown, no error callbacks are called.

svperfecta commented 11 years ago

Note: On the plus side, it seems to reconnect quite well!

mattweber commented 10 years ago

I will look into this. Is this with the jquery client only?

brubrant commented 10 years ago

I think it affects node as well. If I lose connection to elasticseach my app/server crashes.

mattweber commented 10 years ago

Low level client support is being removed due to the release of the official javascript client. The next version of elastic.js will provide full integration with the official client. The official client support node, angular, and jquery clients as well, so please investigate using that with the master version of elastic.js.