Node-redis: Process will exit when could not connect to redis

Created on 26 Jan 2018  路  1Comment  路  Source: NodeRedis/node-redis

  • Version: 2.8.0
  • Platform: Debian 4.9.65-3
  • Description: I give a connect string which is not correct(just for testing), when I try to connect to redis. the node process exit with error:
events.js:137
      throw er; // Unhandled 'error' event
      ^

Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
    at Object._errnoException (util.js:1003:13)
    at _exceptionWithHostPort (util.js:1024:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1194:14)
npm ERR! Test failed.  See above for more details.
question

Most helpful comment

@taoqf you always have to add the error listener as described in the README.md to handle errors properly.

>All comments

@taoqf you always have to add the error listener as described in the README.md to handle errors properly.

Was this page helpful?
0 / 5 - 0 ratings