Implement Q like promise.done()

RESOLVED WONTFIX

Status

Add-on SDK
General
P1
normal
RESOLVED WONTFIX
5 years ago
4 years ago

People

(Reporter: erikvold, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Promise.and() would log errors in the console and not take a 2nd argument, unlike Promise.then().

Usage would be like so:

promise.then(a).then(b).and(c);

which would log an error in a, b or c
Duplicate of this bug: 850826
We need to implement .done() method similar to one that Q has. It's documented
in details here:

http://documentup.com/kriskowal/q/#tutorial/the-end
Summary: Implement promise.and() → Implement Q like promise.done()
Assignee: nobody → jsantell
From the document you linked: « This is a stopgap. We are exploring ways to make unhandled errors visible without any explicit handling. »
See also bug 766078 for a possible implementation strategy. For debugging mode only, of course.
Note that setting

    promise._reportErrors = true;

Allows a degree of error reporting by default that seems to be working OK for us right now.

Not saying that .done(); isn't useful, just that we're not shouting for it as much.
The current promises implementation is based off of the extremely large Q, and implementing done would require a lot of rewriting -- currently investigating other Promise implementations to leverage rather than pulling out subsets from Q when we need to add a new feature (rsvp, when), while keeping the current API.
(In reply to Jordan Santell [:jsantell] [@jsantell] from comment #6)
> The current promises implementation is based off of the extremely large Q,
> and implementing done would require a lot of rewriting -- currently
> investigating other Promise implementations to leverage rather than pulling
> out subsets from Q when we need to add a new feature (rsvp, when), while
> keeping the current API.

It's code looks a lot closer to "when" to me. Irakli?

Updated

5 years ago
Priority: -- → P1
Whiteboard: [good first bug]
Assignee: jsantell → nobody
Hard to believe this is a [good first bug]
Anyway, the whole module is deprecated.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → WONTFIX
Whiteboard: [good first bug]
You need to log in before you can comment on or make changes to this bug.