Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.

Commit d10cdb6

Browse files
committed
Improve error messages for coroutine exceptions in base.rfc
1 parent 932a111 commit d10cdb6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

base.rfc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,7 +1610,7 @@ $scope->spawn(function() {
16101610

16111611
$scope->cancel();
16121612

1613-
$scope->spawn(function() { // <- Fatal error
1613+
$scope->spawn(function() { // <- AsyncException: Coroutine scope is closed
16141614
echo "Task 2\n";
16151615
});
16161616
</code>
@@ -1641,7 +1641,7 @@ An attempt to use the expression ''await($coroutine)'' from within the same coro
16411641
<code php>
16421642
$coroutine = null;
16431643
$coroutine = spawn(function() use(&$coroutine) {
1644-
await($coroutine); // <- Fatal error: A coroutine cannot await itself. Coroutine spawned at ...
1644+
await($coroutine); // <- AsyncException: A coroutine cannot await itself. Coroutine spawned at ...
16451645
});
16461646
</code>
16471647

@@ -1653,7 +1653,7 @@ This condition makes it impossible to perform the ''$globalScope->awaitCompletio
16531653
$scope = new Scope();
16541654

16551655
$scope->spawn(function() use($scope) {
1656-
$scope->awaitCompletion(Async\timeout(1000)); // <- Fatal error: Awaiting a scope from within itself or
1656+
$scope->awaitCompletion(Async\timeout(1000)); // <- AsyncException: Awaiting a scope from within itself or
16571657
// its child scope would cause a deadlock. Scope created at ...
16581658
});
16591659
</code>

0 commit comments

Comments
 (0)