Ejemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Program_AggregateExceptionCatched(object sender, AggregateExceptionArgs e)
 {
     foreach (Exception item in e.AggregateException.InnerExceptions)
     {
         logAction(item);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="task"></param>
 /// <returns></returns>
 private Task ContinueWith(Task task)
 {
     return(task.ContinueWith(t =>
     {
         if (t.Exception != null)
         {
             AggregateExceptionArgs errArgs = new AggregateExceptionArgs()
             {
                 AggregateException = new AggregateException(t.Exception.InnerExceptions)
             };
             AggregateExceptionCatched(null, errArgs);
         }
     }, TaskContinuationOptions.OnlyOnFaulted));
 }