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