public static void Main()
ParallelQuery<int> query = Enumerable.Range(1, 2)
if (x == 2) { Thread.Sleep(500); throw new Exception($"Oops!"); }
foreach (var item in query)
Console.WriteLine($"Consuming item #{item} started");
throw new Exception($"Consuming item #{item} failed");
catch (AggregateException aex)
Console.WriteLine($"AggregateException ({aex.InnerExceptions.Count})");
foreach (var ex in aex.InnerExceptions)
Console.WriteLine($"- {ex.GetType().Name}: {ex.Message}");
Console.WriteLine($"{ex.GetType().Name}: {ex.Message}");