loopbackio / loopback-connector-redis

EXPERIMENTAL: Redis connector for LoopBack.
http://loopback.io/doc/en/lb2/Redis-connector.html
Other
36 stars 46 forks source link

crashes the application on connection-errors #51

Open netzkind opened 7 years ago

netzkind commented 7 years ago

Bug or feature request

Description steps to reproduce bug

Use redis as datasource for a model and set an invalid hostname for redis (thereby simulating a non-reachable redis instance).

Expected result

error-message in console

Actual result (if bug)

application crashes:

Error: Redis connection to redis:6379 failed - getaddrinfo EAI_AGAIN redis:6379
    at RedisClient.flush_and_error (/app/node_modules/redis/index.js:149:13)
    at RedisClient.on_error (/app/node_modules/redis/index.js:191:10)
    at Socket.<anonymous> (/app/node_modules/redis/index.js:106:14)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at connectErrorNT (net.js:1022:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickDomainCallback (internal/process/next_tick.js:122:9)
/app/node_modules/strong-globalize/lib/helper.js:740
      matched = (name.indexOf(header) === 0);
                      ^

TypeError: name.indexOf is not a function
    at /app/node_modules/strong-globalize/lib/helper.js:740:23
    at Array.forEach (native)
    at headerIncluded (/app/node_modules/strong-globalize/lib/helper.js:738:20)
    at Object.hashKeys (/app/node_modules/strong-globalize/lib/helper.js:109:12)
    at formatMessage (/app/node_modules/strong-globalize/lib/globalize.js:96:14)
    at packMessage (/app/node_modules/strong-globalize/lib/globalize.js:201:17)
    at Object.rfc5424 (/app/node_modules/strong-globalize/lib/globalize.js:224:10)
    at StrongGlobalize.log (/app/node_modules/strong-globalize/index.js:185:20)
    at RedisClient.<anonymous> (/app/node_modules/loopback-connector-redis/lib/redis.js:56:7)
    at emitOne (events.js:96:13)
    at RedisClient.emit (events.js:188:7)
    at RedisClient.on_error (/app/node_modules/redis/index.js:196:10)
    at Socket.<anonymous> (/app/node_modules/redis/index.js:106:14)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at connectErrorNT (net.js:1022:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickDomainCallback (internal/process/next_tick.js:122:9)

Additional information (Node.js version, LoopBack version, etc)

Node.js 6.9.2 Loopback 2.22.0 loopback-connector-redis 0.1.0

netzkind commented 7 years ago

Fixed with #52

Is there a roadmap for the next release?