using System;
using System.Threading.Tasks;
var task = Method1();
try
{
await task;
}
catch (Exception e)
Console.WriteLine(e);
static async Task<int> Method2()
throw new Exception("in method 2");
static Task<int> Method1()
throw new Exception("in method 1");
return Method2();