internal bool ShouldRetryBasedOnHttpOutput()

in AdlsDotNetSDK/RetryPolicies/RetryPolicy.cs [15:30]


        internal bool ShouldRetryBasedOnHttpOutput(int httpCode, Exception ex)
        {
            //HTTP CODE 1xx and 2xx are not errors and 3xx are redirection status which shouldnt be retied
            //501 is not immplemented, 505 http version not supported
            if ((httpCode >= 300 && httpCode < 500 && httpCode != 408 && httpCode != 429) ||
                httpCode == 501 || httpCode == 505)
            {
                return false;
            }
            //For 408-timed out and 429-too many responses and 5xx server except the above ones we need retries
            if (ex != null || httpCode >= 500 || httpCode == 408 || httpCode == 429)
            {
                return true;
            }
            return false;
        }