Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
parallel_tasks_exceptions
.gitignore
LICENSE
README.md
parallel_tasks_exceptions.sln
screenshot.jpg

README.md

parallel-tasks-exceptions

Task.WaitAll() and Task.WhenAll() have a different way to handle exceptions: Task.WaitAll() will collect the inner exceptions and wrap them in an AggregateException. Task.WhenAll() instead is re-throwing only the first exception happening.

The only way to retrieve the others is to not await directly the call to Task.WhenAll() but to store instead the returned Task in a variable. In the try/catch block then we can access the task.Exception property, which is an AggregateException, and do whatever we want with its InnerExceptions.

alt text

You can’t perform that action at this time.