在 BulkMutateJob 中检索作业部分的结果时出错
我对 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为此错误表明您为 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