public RetryOptions(short retryCount, TimeSpan delay, RetryStrategyType type = RetryStrategyType.Simple, params Type[] exceptionTypeTypes)
        {
            foreach (Type exceptionType in exceptionTypeTypes)
            {
                if (!typeof(Exception).IsAssignableFrom(exceptionType))
                {
                    throw new ArgumentException($"All exception types must be valid exceptions. {exceptionType} is not an Exception.");
                }
            }

            if (retryCount < 1)
            {
                throw new ArgumentOutOfRangeException(nameof(retryCount), "Retry count cannot be less or equal to 0.");
            }

            this.RetryCount     = retryCount;
            this.Delay          = delay;
            this.ExceptionTypes = exceptionTypeTypes;
            this.Type           = type;
        }
示例#2
0
 public DBreezeRetryOptions(RetryStrategyType type = RetryStrategyType.Simple)
     : base(1, TimeSpan.FromMilliseconds(100), type, typeof(TableNotOperableException))
 {
 }