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

发布于 2024-11-13 06:46:18 字数 1014 浏览 0 评论 0原文

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

我正在尝试为不同的群体更新大量的广告词。我创建了一个作业,它正在成功运行并获得状态“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

I have a question about google adwords API service: BulkMutateJob.

I'm trying to update a lot of adwords for different groups. I create a job and it is being run successfully and gets the status "COMPLETED" but then I want to retrieve the results for the parts for this job and get the error:

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

The code is:

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

喜爱皱眉﹌ 2024-11-20 06:46:18

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

I think this error is indicating that you are passing in a negative number for resultPartIndex. FYI, the official AdWords API forum is here: http://code.google.com/apis/adwords/forum.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文