Skip to content

Commit

Permalink
Merge pull request ortoo#21 from phtrivier/master
Browse files Browse the repository at this point in the history
when.catch instead of fail
  • Loading branch information
jamessharp committed Oct 29, 2014
2 parents eec7762 + 8eaef23 commit 7a0f92b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 7a0f92b

Please sign in to comment.