Exemplo n.º 1
0
 public static Task <TResult> ContinueWithErrorHandling <TResult, TInput>(this Task <TInput> task, Func <Task <TInput>, TResult> continuationFunction, ITaskErrorLogger logger)
 {
     if (task.IsFaulted)
     {
         logger.LogTaskError(task);
     }
     return(task.ContinueWith(continuationFunction));
 }
Exemplo n.º 2
0
 public static Task ContinueWithErrorHandling <T>(this Task <T> task, Action <Task <T> > continuationAction, ITaskErrorLogger logger)
 {
     if (task.IsFaulted)
     {
         logger.LogTaskError(task);
     }
     return(task.ContinueWith(continuationAction));
 }