Skip to content

Commit

Permalink
Check options.error
Browse files Browse the repository at this point in the history
options.error it sometimes null.
Example code should check it before reference options.error.code.
(See also #1159 )
  • Loading branch information
katoken-0215 authored Nov 4, 2016
1 parent be07c12 commit dd3179a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit dd3179a

Please sign in to comment.