Error Handling and Cancellation
Propagate failures cleanly.
Failures in a Tree of Tasks
When subtasks run concurrently, errors can happen in any branch. Structured concurrency gives you a disciplined way to propagate those failures up to the parent.
This lesson covers exceptions, cancellation, interruption, and timeouts.
Where Exceptions Surface
A subtask that throws does not crash your program immediately. The exception is captured on its Subtask handle. Where it surfaces depends on the policy:
ShutdownOnFailure: atthrowIfFailed()ShutdownOnSuccess: atresult()if none succeeded
All lessons in this course
- The Structured Concurrency Model
- StructuredTaskScope
- Shutdown on Failure and Success
- Error Handling and Cancellation