diff --git a/README.md b/README.md index ba02505..802430b 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ try { $value = Block\await($promise, $loop); // promise successfully fulfilled with $value echo 'Result: ' . $value; -} catch (Exeption $exception) { +} catch (Exception $exception) { // promise rejected with $exception echo 'ERROR: ' . $exception->getMessage(); } @@ -167,7 +167,7 @@ remaining promises and return whatever the first promise resolves to. If ALL promises fail to resolve, this will fail and throw an `Exception`. If no $timeout is given and either promise stays pending, then this will -potentially wait/block forever until the last promise is settled. +potentially wait/block forever until the first promise is settled. If a $timeout is given and either promise is still pending once the timeout triggers, this will `cancel()` all pending promises and throw a `TimeoutException`. diff --git a/src/functions.php b/src/functions.php index 2c59183..65c54be 100644 --- a/src/functions.php +++ b/src/functions.php @@ -104,7 +104,7 @@ function ($error) use (&$exception, &$rejected, &$wait, $loop) { * If ALL promises fail to resolve, this will fail and throw an Exception. * * If no $timeout is given and either promise stays pending, then this will - * potentially wait/block forever until the last promise is settled. + * potentially wait/block forever until the first promise is settled. * * If a $timeout is given and either promise is still pending once the timeout * triggers, this will cancel() all pending promises and throw a `TimeoutException`.