Skip to content

Commit

Permalink
fix(middleware): Obey the Promise API.
Browse files Browse the repository at this point in the history
Rather than catching and discarding the error if no error handler is passed, let the promise package chain it. This allows use to have a .catch() follow the then().
  • Loading branch information
johnjbarton authored and lusarz committed Jul 12, 2018
1 parent 518cb11 commit 93ba05a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/middleware/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ class PromiseContainer {
}

then (success, error) {
error = error || _.noop
return this.promise.then(success).catch(error)
return this.promise.then(success, error)
}

set (newPromise) {
Expand Down

0 comments on commit 93ba05a

Please sign in to comment.