public static void Main()
Console.WriteLine("Inner exception?: " + (e.InnerException?.Message ?? "nothing"));
public static void Test() {
Console.WriteLine("Inside Test()");
throw new Exception("thrown from Test()");
} catch (Exception) when (AlwaysThrow()) {
Console.WriteLine("caught exception in Test()");
Console.WriteLine("totally skipped last catch clause, any inner exception: " + (e.InnerException?.Message ?? "nothing"));
public static bool AlwaysThrow() {
Console.WriteLine("Inside AlwaysThrow()");
throw new Exception("thrown from AlwaysThrow()");
Console.WriteLine("wont reach");