public static void FatalException(this ILogEnd log, Exception e) { log.Fatal(e); var ae = e as AggregateException; if (ae != null) { foreach (var _e in ae.InnerExceptions) { log.FatalException(_e); } } }
public static async Task WaitAllAsync(this List <Task> tasks, ILogEnd log = null) { try { await Task.WhenAll(tasks.ToArray()); } catch (Exception e) { if (log == null) { throw; } else { log.FatalException(e); } } }
public static void WaitAll(this List <Task> tasks, ILogEnd log = null) { try { Task.WaitAll(tasks.ToArray()); } catch (Exception e) { if (log == null) { throw; } else { log.FatalException(e); } } }