在BulkMutateJob中检索作业部件的结果时出错

时间:2011-06-02 10:07:28

标签: ruby google-adwords

我对谷歌adwords API服务有疑问:BulkMutateJob。

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

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

1 个答案:

答案 0 :(得分:0)

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