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'); }