public static void Main()
DoSomethingThatMightFail();
catch (Exception ex) when (Log(ex, "An error occurred"))
public static void DoSomethingThatMightFail()
static bool Log(Exception ex, string message, params object[] args)
Console.WriteLine(message, args);