0

我有一个关于 google adwords API 服务的问题:BulkMutateJob。

我正在尝试为不同的群体更新很多广告词。我创建了一个作业,它正在成功运行并获得“已完成”状态,但随后我想检索该作业部件的结果并得到错误:

inner_fault: !ruby/exception:SOAP::FaultError 
message: "[RangeError.TOO_HIGH @ selector.resultPartIndex]"

代码是:

if status == 'COMPLETED' and error == false
  puts 'Job completed!'
  # Retrieve the results for the parts.
  0.upto(parts) do |part_index|
    selector = bulk_mutate_job_srv.module::BulkMutateJobSelector.new
    selector.jobIds = [job_id]
    # Retrieve results for the first part.
    selector.resultPartIndex = part_index
    results = bulk_mutate_job_srv.get(selector)
    if results and results.entries
      results.each do |result|
        puts 'Part %d/%d of job #%d has successfully completed' %
        [part_index + 1, job[:parts], job_id]
      end
    else
      raise 'Error retrieving job results; aborting.'
    end
  end
else
  puts "Job failed: #{get_response.entries[0].failureReason}"
end
4

1 回答 1

0

我认为这个错误表明您正在为 resultPartIndex 传递一个负数。仅供参考,官方 AdWords API 论坛在这里:http ://code.google.com/apis/adwords/forum.html

于 2011-06-03T14:44:58.023 回答