The rejection value must be an Exception
clue opened this issue · 1 comments
clue commented
The following code is not supported:
$promise = React\Promise\reject(123);
$blocker = new Blocker($loop);
// will fail while trying to `throw 123`
$blocker->await($promise);
At the very least, we should add some documentation.
In the future, we should consider wrapping primitive values in some special Exception
sub-class.
clue commented
See also reactphp/promise#46