示例#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;
 }
示例#2
0
 internal static bool IsRetryableByDefault(this CommandFailed failure) =>
 !failure.IsCanceled &&
 failure.NumberOfPreviousAttempts < DefaultNumberOfRetriesOnException;
示例#3
0
 internal static bool CommandHandlerDidNotSpecifyRetry(this CommandFailed failure) =>
 failure.RetryAfter == null;
示例#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);
 }