Lidar com todos os agregateExceptions ao usar a tarefa.
Task aggregationTask = null;
try{
var task1 = DoSomethingAsync();
var task2 = DoSomethingElseAsync();
aggregationTask = Task.WhenAll(task1, task2);
await aggregationTask;
}catch(Exception ex){
if(aggregationTask?.Exception?.InnerExceptions != null && aggregationTask.Exception.InnerExceptions.Any())
foreach (var innerEx in aggregationTask.Exception.InnerExceptions){
// do your magic here
}
}
addubs