File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -422,7 +422,9 @@ Returns a promise that will resolve when any one of the items in
422422will be the resolution value of the triggering item.
423423
424424The returned promise will only reject if * all* items in ` $promisesOrValues ` are
425- rejected. The rejection value will be an array of all rejection reasons.
425+ rejected. The rejection value will be a ` React\Promise\Exception\CompositeException `
426+ which holds all rejection reasons. The rejection reasons can be obtained with
427+ ` CompositeException::getExceptions() ` .
426428
427429The returned promise will also reject with a ` React\Promise\Exception\LengthException `
428430if ` $promisesOrValues ` contains 0 items.
@@ -440,8 +442,9 @@ triggering items.
440442
441443The returned promise will reject if it becomes impossible for ` $howMany ` items
442444to resolve (that is, when ` (count($promisesOrValues) - $howMany) + 1 ` items
443- reject). The rejection value will be an array of
444- ` (count($promisesOrValues) - $howMany) + 1 ` rejection reasons.
445+ reject). The rejection value will be a ` React\Promise\Exception\CompositeException `
446+ which holds ` (count($promisesOrValues) - $howMany) + 1 ` rejection reasons.
447+ The rejection reasons can be obtained with ` CompositeException::getExceptions() ` .
445448
446449The returned promise will also reject with a ` React\Promise\Exception\LengthException `
447450if ` $promisesOrValues ` contains less items than ` $howMany ` .
Original file line number Diff line number Diff line change 22
33namespace React \Promise \Exception ;
44
5+ /**
6+ * Represents an exception that is a composite of one or more other exceptions.
7+ *
8+ * This exception is useful in situations where a promise must be rejected
9+ * with multiple exceptions. It is used for example to reject the returned
10+ * promise from `some()` and `any()` when too many input promises reject.
11+ */
512class CompositeException extends \Exception
613{
714 private $ exceptions ;
You can’t perform that action at this time.
0 commit comments