From 4501a20c272411d525eade5f4429ae2fa0db426c Mon Sep 17 00:00:00 2001 From: mayinghan Date: Wed, 24 Jul 2019 21:00:49 +0800 Subject: [PATCH] explicitly handle redis connection error --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index c822da9..89f505b 100644 --- a/index.js +++ b/index.js @@ -26,7 +26,12 @@ function seenreq(options) { } this.repo = new Repo(options); - + + //handle redis error + if(options.repo === 'redis') { + this.repo.redis.once('error', (err)=> {throw new Error(err)}) + } + if(!options.normalizer){ Normalizers.push(require('./lib/normalizer/default.js')); }else{