Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 395853

Summary: Allow "optOnError" param to be a boolean in Deferred.all
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: ClientAssignee: Project Inbox <orion.client-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: susan
Version: 2.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2012-12-05 14:22:02 EST
There are two different ways Deferred.all can be invoked:

1)
> Deferred.all(promises)
Returns a promise that resolves once all promises have resolved, or rejects as soon as a single promise has rejected (fail fast).

2)
> Deferred.all(promises, optOnError)
Returns a promise that resolves once all promises have been fulfilled (i.e. rejected or resolved). The returned promise always resolves; rejections are delegated to the optOnError function.

Here the optOnError parameter does double duty as both:
 i) A handler to intercept individual rejections (and optionally transform them into another value in the final results array)
ii) A flag to disable the fail-fast behavior of .all() and guarantee that every promise is fulfilled.

Sometimes you only want (ii) and don't care about (i). In these cases, it would be convenient to call

> Deferred.all(promises, true)

... which would be equivalent to writing this under the current behavior:

> Deferred.all(promises, function(e) {return e;})
Comment 1 John Arthorne CLA 2015-05-05 15:50:36 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:


https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html
Comment 2 John Arthorne CLA 2015-05-05 16:03:08 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:


https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html