Skip to content

Commit 93ba05a

Browse files
johnjbartonlusarz
authored andcommitted
fix(middleware): Obey the Promise API.
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().
1 parent 518cb11 commit 93ba05a

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

lib/middleware/common.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ class PromiseContainer {
1616
}
1717

1818
then (success, error) {
19-
error = error || _.noop
20-
return this.promise.then(success).catch(error)
19+
return this.promise.then(success, error)
2120
}
2221

2322
set (newPromise) {

0 commit comments

Comments
 (0)