Error propagation¤
If any coroutine raises an error, then:
- All coroutines across the entire loop will have
tinyio.CancelledErrorraised in them (from whateveryieldpoint they are currently waiting at). - Any functions ran in threads via
tinyio.run_in_threadwill also havetinyio.CancelledErrorraised in the thread. - The original error is raised out of
tinyio.Loop.run. This behaviour can be configured (e.g. to collect errors into aBaseExceptionGroup) by setting.run(..., exception_group=None/False/True).
This gives every coroutine a chance to shut down gracefully. Debuggers like patdb offer the ability to navigate across exceptions in an exception group, allowing you to inspect the state of all coroutines that were related to the error.
tinyio.CancelledError(BaseException)
¤
Raised when a tinyio coroutine is cancelled due an error in another coroutine.