I\'m running into a few issues where I call flatten on an AggregateException, but inside there is still ANOTHER AggregateException! T
Normally AggregateException is used to consolidate multiple failures into a single, throwable exception object.
try {
Task.WaitAll(tasks)
}
catch (AggregateException ae) {
ae.Handle((x) =>
{
if (x is UnauthorizedAccessException) // This we know how to handle.
{
//do your code here
}
return true; //if you do something like this all exceptions are marked as handled
});
}