Monday, 19 August 2013

Task.WaitAll, how to find the tasks causing AggregateException

Task.WaitAll, how to find the tasks causing AggregateException

Let's say that I got the following code:
var tasks = BuildTaskList();
try
{
Task.WaitAll(tasks.ToArray());
}
catch (AggregateException exception)
{
}
How do I know which task threw which of the exceptions in
exception.InnerExceptions?

No comments:

Post a Comment