/// <summary> /// Determines if an AmazonServiceException is a throttling error /// </summary> /// <param name="exception">The current exception to check.</param> /// <returns>true if it is a throttling error else false.</returns> public virtual bool IsThrottlingError(Exception exception) { var serviceException = exception as AmazonServiceException; return(serviceException?.Retryable?.Throttling == true || ThrottlingErrorCodes.Contains(serviceException?.ErrorCode)); }
/// <summary> /// Constructor for DynamoDBRRetryPolicy. /// </summary> /// <param name="config">The IClientConfig object</param> public DynamoDBRetryPolicy(IClientConfig config) : base(config) { ThrottlingErrorCodes.Add("TransactionInProgressException"); //When derived from DefaultRetryPolicy, we are in legacy retry //mode. When in legacy retry mode MaxErrorRetry used to be set //to 10 in the DynamoDB and DynamoDBStreams configs. This //can no longer be set in the configs because the retry mode //may not be known at that point where standard and adaptive //retry modes are not to have this default. if (!config.IsMaxErrorRetrySet) { this.MaxRetries = 10; } }
/// <summary> /// Constructor for EC2AdaptiveRetryPolicy. /// </summary> /// <param name="config">The IClientConfig object</param> public EC2AdaptiveRetryPolicy(IClientConfig config) : base(config) { ThrottlingErrorCodes.Add("EC2ThrottledException"); }