+Near the end of the code snippet, notice the `await finishedTask;` expression. This line is important because `Task.WhenAny` returns a `Task<Task>` - a wrapper task that contains the completed task. When you `await Task.WhenAny`, you're waiting for the wrapper task to complete, and the result is the actual task that finished first. However, to retrieve that task's result or ensure any exceptions are properly thrown, you must `await` the completed task itself (stored in `finishedTask`). Even though you know the task has finished, awaiting it again allows you to access its result or handle any exceptions that might have caused it to fault.
0 commit comments