2013-10-29 28 views
0

是否有方法從APIError獲取標準信息?Google Adwords API:獲取APIError的標準信息

MutateJobService mutateJobService = (MutateJobService)user.GetService(AdWordsService.v201309.MutateJobService); 
    JobResult jobResult = mutateJobService.getResult(new BulkMutateJobSelector { includeStats = true, jobIds = jobIDs }); 
    SimpleMutateResult results = (SimpleMutateResult)jobResult.Item; 

    if (results.errors != null) 
    { 
     foreach (ApiError apiError in results.errors) 
     { 
      // get criterion info 
     } 
    } 

我發現很難得到一個特定的錯誤詳細信息,(這是必須進行日誌記錄顯然是重要的)。任何幫助表示讚賞。

回答

0

你可以期待的錯誤,並期待在其

  • fieldPath
  • trigger
  • errorString
  • type
  • reason

更多文檔在這裏:https://developers.google.com/adwords/api/docs/reference/latest/CampaignService.ApiError

+0

正確...我知道我可以訪問該錯誤的直接屬性,但是我正在尋找一種方法來深入挖掘並訪問實際的標準信息。有一種方法... – Rivka

+0

你也得到'結果',這是你提交的操作數列表 - 你的情況標準 - 沒有'幫助? – iluxa

+0

不,因爲如果特定條件失敗,則operand.Item的計算結果爲「PlaceHolder」,無法轉換爲正確的CriterionType以獲取屬性值。 – Rivka