using System;
using System.Collections.Generic;
using System.Threading.Tasks;
public class Program
{
public static void Main()
try
DoSomething1().GetAwaiter().GetResult();
}
catch (Exception ex)
Console.WriteLine(ex);
public static Task DoSomething1()
return DoSomething2();
public static Task DoSomething2()
throw new Exception("DoSomething2 failed");