apla / node-clickhouse

Yandex ClickHouse driver for nodejs
MIT License
216 stars 50 forks source link

No error handling #5

Closed tommiv closed 6 years ago

tommiv commented 6 years ago

For example, any ECONNREFUSED causes an application crash. For example, if CH server is down.

const clickhouse = new ClickHouse(config.clickhouse);
clickhouse.query('select 1', (...args) => console.log(args)); // <= crash here
clickhouse.ping((...args) => console.log(args)); // <= crash here
events.js:137
      throw er; // Unhandled 'error' event
      ^

Error: connect ECONNREFUSED 127.0.0.1:8123
    at Object._errnoException (util.js:1003:13)
    at _exceptionWithHostPort (util.js:1024:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1195:14)

Therefore, it's not possible to use this lib in production. There is a PR #3 about it, but looks like it is ignored. Is this repo alive?

apla commented 6 years ago

fixed in v/1.5.1

tommiv commented 6 years ago

It works just fine now, thank you!