.NET Fiddle

CSharp · Console

/Program.cs

using System;
using System.Threading.Tasks;
					
public class Program
{
	private static async Task<int> Method4(int p){
			throw new Exception();
	}
	
	private static  Task<int> Method3(int p){
			return  Method4(p);
	}
	
	private static   Task<int> Method2(int p){
			return  Method4(p);
	}
	
	private static async Task<int> Method1(int p){
			if(p == 0)
				return await Method2(p);
			else
				return await Method3(p);
	}
	
	
	public async static Task Main()
	{
		try{
			await Method1(0);
		}catch(Exception e){
			Console.WriteLine(e);
		}
		try{
			await Method1(1);
		}catch(Exception e){
			Console.WriteLine(e);
		}
	}
}
;