Skip to content

Commit 4b27f79

Browse files
authored
Merge pull request #1168 from katoken-0215/wrong-example-retry-strategy
Check options.error
2 parents ee6aba4 + dd3179a commit 4b27f79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ retry_strategy example
224224
```js
225225
var client = redis.createClient({
226226
retry_strategy: function (options) {
227-
if (options.error.code === 'ECONNREFUSED') {
227+
if (options.error && options.error.code === 'ECONNREFUSED') {
228228
// End reconnecting on a specific error and flush all commands with a individual error
229229
return new Error('The server refused the connection');
230230
}

0 commit comments

Comments
 (0)