File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -959,8 +959,10 @@ in a loop. The coro `asyn.sleep` [supports this](./PRIMITIVES.md#41-coro-sleep).
959
959
960
960
Where an exception occurs in a coro, it should be trapped either in that coro
961
961
or in a coro which is awaiting its completion. This ensures that the exception
962
- is not propagated to the scheduler. If this occurred it would stop running,
963
- passing the exception to the code which started the scheduler.
962
+ is not propagated to the scheduler. If this occurred the scheduler would stop
963
+ running, passing the exception to the code which started the scheduler.
964
+ Consequently, to avoid stopping the scheduler, coros launched with
965
+ ` loop.create_task() ` must trap any exceptions internally.
964
966
965
967
Using ` throw ` or ` close ` to throw an exception to a coro is unwise. It subverts
966
968
` uasyncio ` by forcing the coro to run, and possibly terminate, when it is still
You can’t perform that action at this time.
0 commit comments