2011-06-02 47 views
0

我對Google AdWords API服務有個疑問:BulkMutateJob。檢索BulkMutateJob中作業部分的結果時出錯

我試圖更新很多不同組的AdWords。我創建了一個工作,它正在成功運行,並得到「已完成」的狀態,但後來我想檢索適合這個工作的部分結果並且得到錯誤:

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 

回答