Well, we have learned how to start, coordinate, and cancel tasks. Now, let's talk about error handling with tasks. In C#, when we discuss error handling, we are really talking about the
try..catch..finally structure. In this book, we assume you are familiar with the operation of a
A task has a lifecycle of states that it can be in. A task can be idle (scheduled), running, pending, cancelled, faulted, or completed. Each task has a
status property that defines the current state of the task. We saw this in the last section and used
OnlyOnRanToCompletion as the options for
TaskContinuationOptions for our
So, when we talk about exception handling with TPL, we are referring ...