#17211 closed defect (wontfix)
Promise.always doesn't propagate errors
Reported by: | jandockx | Owned by: | Mark Wubben |
---|---|---|---|
Priority: | undecided | Milestone: | tbd |
Component: | Core | Version: | 1.9.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Promise always doesn't propagate errors.
The current implementation is
always: function(callbackOrErrback){ // summary: // Add a callback to be invoked when the promise is resolved // or rejected. // callbackOrErrback: Function? // A function that is used both as a callback and errback. // returns: dojo/promise/Promise // Returns a new promise for the result of the callback/errback. return this.then(callbackOrErrback, callbackOrErrback); }
It should be
return this.then( callbackOrErrBack, function(err) { callbackOrErrBack.call(); throw err; } );
Change History (4)
comment:1 Changed 8 years ago by
Component: | General → Core |
---|---|
Owner: | set to Mark Wubben |
Status: | new → assigned |
comment:2 Changed 8 years ago by
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
Yes this is as intended. You shouldn't handle rejections separately from fulfillment in these callbacks, if you need that use then()
.
comment:3 Changed 8 years ago by
Summary: | Promise.always is wrong → Promise.always doesn't propagate errors |
---|
Give ticket hopefully meaningful summary.
comment:4 Changed 8 years ago by
got it; I though it was intended as a "finally"; maybe that could be a separate (new) function
Note: See
TracTickets for help on using
tickets.
i'm fairly sure our implementation is intentionally like this. i'll leave it to mark to give further feedback or close the ticket.