Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ScheduledCommandException"/> class.
 /// </summary>
 /// <param name="failure">The failure.</param>
 /// <exception cref="System.ArgumentNullException"></exception>
 public ScheduledCommandException(CommandFailed failure)
     : base(failure.Exception
            .IfNotNull()
            .Then(e => e.Message)
            .Else(() => "Scheduled command failed"),
            failure.Exception)
 {
     if (failure == null)
     {
         throw new ArgumentNullException(nameof(failure));
     }
     Failure = failure;
 }
Ejemplo n.º 2
0
 internal static bool IsRetryableByDefault(this CommandFailed failure) =>
 !failure.IsCanceled &&
 failure.NumberOfPreviousAttempts < DefaultNumberOfRetriesOnException;
Ejemplo n.º 3
0
 internal static bool CommandHandlerDidNotSpecifyRetry(this CommandFailed failure) =>
 failure.RetryAfter == null;
Ejemplo n.º 4
0
 public Task HandleScheduledCommandException(
     TTarget target,
     CommandFailed <TCommand> command) =>
 handleScheduledCommandException(target, command);
 private static bool IsRetryableByDefault(CommandFailed failure)
 {
     return(!failure.IsCanceled && failure.NumberOfPreviousAttempts < DefaultNumberOfRetriesOnException);
 }
 private static bool CommandHandlerDidNotSpecifyRetry(CommandFailed failure)
 {
     return(failure.RetryAfter == null);
 }