From dd3179a183e5a2ad4bbf56cac0ae6c0a9e0da45a Mon Sep 17 00:00:00 2001 From: "Kenji.Kato" Date: Sat, 5 Nov 2016 03:31:20 +0900 Subject: [PATCH] Check options.error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit options.error it sometimes null. Example code should check it before reference options.error.code. (See also #1159 ) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 52b60f0f284..fcd9ef499ea 100644 --- a/README.md +++ b/README.md @@ -224,7 +224,7 @@ retry_strategy example ```js var client = redis.createClient({ retry_strategy: function (options) { - if (options.error.code === 'ECONNREFUSED') { + if (options.error && options.error.code === 'ECONNREFUSED') { // End reconnecting on a specific error and flush all commands with a individual error return new Error('The server refused the connection'); }