Catch ECONNREFUSED exceptions
Problem
Hi, I want to test what happens to my application when redis goes down. So after starting the server I manually stop the redis daemon that's running on my machine, and I expect to have the errors reported on my error callback/promise. Instead, I get uncaught exceptions all over the place. I've tried using a custom `retryStrategy`, I've tried to set `Redis.Promise.onPossiblyUnhandledRejection` as well... all with no luck. Is there something I'm missing here? How am I supposed to test what happens to my server if for any reason redis stops working? Thanks
Error Output
error callback/promise.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Catch ECONNREFUSED exceptions
Have you listened to the `error` event to the redis instance? `redis.on('error', handleError)`
Trust Score
1 verification
- 1
Have you listened to the `error` event to the redis instance? `redis.on('error',
Have you listened to the `error` event to the redis instance? `redis.on('error', handleError)`
Validation
Resolved in redis/ioredis GitHub issue #321. Community reactions: 0 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep