using System.Threading.Tasks;
public static void Main()
var task = WriteToLogAsync();
Console.WriteLine("The exception goes unnoticed");
var message = task.Exception.InnerExceptions[0].Message;
Console.WriteLine(message);
public static async Task WriteToLogAsync()
System.Console.WriteLine("Trying to write to the log");
throw new Exception("This exception is lost");