Skip to content

Commit

Permalink
Swallow error by locally passed errorHandler option
Browse files Browse the repository at this point in the history
  • Loading branch information
MadLittleMods committed Nov 16, 2016
1 parent 5671155 commit 627cd11
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,14 @@ Client.prototype = {

});

/* Custom error handler */
if (!options.disableErrorHandler && this.errorHandler) {
return promise.catch(this.errorHandler);
// Try the local error handler
if (options.errorHandler) {
promise = promise.catch(options.errorHandler);
}

// Fallback to the global error handler
if (this.errorHandler) {
promise = promise.catch(this.errorHandler);
}

return promise;
Expand Down

0 comments on commit 627cd11

Please sign in to comment.