def handle_retry_with(retry_result, type, request_uuid, expires_at, attempts)
      case (interval = retry_interval(expires_at, attempts, 1))
      when nil
        @stats["request failures"].update("#{type} - retry")
        raise Exceptions::RetryableError.new(retry_result.http_body, retry_result)
      when 0
        @stats["request failures"].update("#{type} - retry")
        raise Exceptions::RetryableError.new(retry_result.http_body, retry_result)
      else
        ErrorTracker.log(self, "Retrying #{type} request <#{request_uuid}> in #{interval} seconds " +
                               "in response to retryable error (#{retry_result.http_body})")
        wait(interval)
      end
      # Change request_uuid so that retried request not rejected as duplicate
      "#{request_uuid}:retry"
    end
def handle_retry_with(retry_result, type, request_uuid, expires_at, attempts)
      case (interval = retry_interval(expires_at, attempts, 1))
      when nil
        @stats["request failures"].update("#{type} - retry")
        raise Exceptions::RetryableError.new(retry_result.http_body, retry_result)
      when 0
        @stats["request failures"].update("#{type} - retry")
        raise Exceptions::RetryableError.new(retry_result.http_body, retry_result)
      else
        ErrorTracker.log(self, "Retrying #{type} request <#{request_uuid}> in #{interval} seconds " +
                               "in response to retryable error (#{retry_result.http_body})")
        wait(interval)
      end
      # Change request_uuid so that retried request not rejected as duplicate
      "#{request_uuid}:retry"
    end
Handle retry response by retrying it only once
 This indicates the request was received but a retryable error prevented
 it from being processed; the retry responsibility may be passed on
 If retrying, this function does not return until it is time to retry

 @param [RestClient::RetryWith] retry_result exception raised
 @param [String] type of request for use in logging
 @param [String] request_uuid originally created for this request
 @param [Time] expires_at time for request
 @param [Integer] attempts to make request

 @return [String] request UUID to be used on retry

 @raise [Exceptions::RetryableError] request failed but if retried may succeed