using System.Threading.Tasks;
public static void Main()
Console.WriteLine("Catch in an async method");
Console.WriteLine("Catch in an sync method");
private static void CatchInSync()
var whenAllTask = Task.WhenAll(
private static async Task CatchInAsync()
var whenAllTask = Task.WhenAll(
private static async Task ThrowStuff(int index, bool throwException)
Console.WriteLine("Task: " + index + " started");
throw new Exception("Boom! " + index);