From 8eaef23b0f7c2ec7762a0a756beeda23ce7713a3 Mon Sep 17 00:00:00 2001 From: Pierre-Henri Trivier Date: Wed, 29 Oct 2014 12:08:38 +0100 Subject: [PATCH] when.catch instead of fail --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index e038366..dfa0909 100644 --- a/index.js +++ b/index.js @@ -60,9 +60,9 @@ Sentinel.prototype.createClient = function(masterName, opts) { oldEmit.apply(client, arguments); } }; - + client.on('reconnecting', refreshEndpoints); - + function refreshEndpoints() { resolver(self.endpoints, masterName, function(_err, ip, port) { if (_err) { oldEmit.call(client, 'error', _err); } @@ -160,7 +160,7 @@ function resolveClient() { }); // Catch the failure (if there is one) - promise.fail(function(err) { callback(err); }); + promise.catch(function(err) { callback(err); }); } function isSentinelOk(endpoint, callback) {