Exemplo n.º 1
0
 public virtual async Task <bool> HandleExceptionAsync(HandleExceptionArgs args)
 {
     // if the func returns true try to handle this current failed try
     if (HandleExceptionFunc != null && HandleExceptionFunc(args.Exception))
     {
         return(await HandleAsync(args.SupportsRetry, args.CurrentFailedTry, args.CancellationToken)
                .ConfigureAwait(false));
     }
     return(false);
 }
Exemplo n.º 2
0
 public virtual async Task<bool> HandleExceptionAsync(HandleExceptionArgs args)
 {
     // if the func returns true try to handle this current failed try
     if (HandleExceptionFunc != null && HandleExceptionFunc(args.Exception))
     {
         return await HandleAsync(args.SupportsRetry, args.CurrentFailedTry, args.CancellationToken)
             .ConfigureAwait(false);
     }
     return false;
 }
 public Task<bool> HandleExceptionAsync(HandleExceptionArgs args)
 {
     ++Calls;
     TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>();
     tcs.SetResult(Handle);
     return tcs.Task;
 }
Exemplo n.º 4
0
 public virtual bool HandleException(HandleExceptionArgs args)
 {
     // if the func returns true try to handle this current failed try
     return(HandleExceptionFunc != null && HandleExceptionFunc(args.Exception) &&
            Handle(args.SupportsRetry, args.CurrentFailedTry, args.CancellationToken));
 }