非同步錯誤
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
由於 ExperimentService
包含一些非同步作業,因此用於擷取這些作業相關錯誤的機制與其他同步作業不同。
使用這項錯誤報告機制的非同步作業如下:
針對這些方法,API 會傳回長時間執行的作業,可用於要求非同步作業狀態的詳細資訊。完成後,longrun 作業將填入 error
和 response
欄位。在 Google Ads API 中,該作業一律會在 Empty
中填入 response
值,且出現 error
會表示可從其他 API 呼叫擷取完整的錯誤清單。
如果在長時間執行過程中傳回了完整的錯誤清單,如果您沒有在非同步進度上追蹤後續錯誤,則錯誤可能會遺失,而回應可能會比簡易輪詢要求的預期更大。因此,長期執行的作業只會指出有錯誤,且要擷取特定錯誤,您必須使用 API 端點。
如果是與這些以實驗為基礎的長時間執行作業相關的錯誤,請使用 ExperimentService.ListExperimentAsyncErrors
。
傳入實驗的資源名稱和網頁大小,然後按照其他 Google Ads API 查詢的結果,逐一瀏覽結果。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-09-05 (世界標準時間)。
[null,null,["上次更新時間:2025-09-05 (世界標準時間)。"],[[["\u003cp\u003eThe \u003ccode\u003eExperimentService\u003c/code\u003e uses a different error reporting mechanism for its asynchronous operations like scheduling and promoting experiments.\u003c/p\u003e\n"],["\u003cp\u003eAsynchronous operations return a longrunning operation; check its \u003ccode\u003eerror\u003c/code\u003e field to see if errors occurred during the operation.\u003c/p\u003e\n"],["\u003cp\u003eTo retrieve the full list of errors for an asynchronous experiment operation, use the \u003ccode\u003eExperimentService.ListExperimentAsyncErrors\u003c/code\u003e method with the experiment's resource name.\u003c/p\u003e\n"],["\u003cp\u003eInstead of including all errors in the initial response, this approach prevents potential data loss and keeps response sizes manageable.\u003c/p\u003e\n"]]],[],null,["# Asynchronous errors\n\nSince the[`ExperimentService`](/google-ads/api/reference/rpc/v21/ExperimentService) contains a few\nasynchronous operations, the mechanism for fetching errors related to these\noperations is different than for other synchronous operations.\n\nThe asynchronous operations that use this error reporting mechanism are:\n\n- [`ExperimentService.ScheduleExperiment`](/google-ads/api/reference/rpc/v21/ExperimentService/ScheduleExperiment)\n- [`ExperimentService.PromoteExperiment`](/google-ads/api/reference/rpc/v21/ExperimentService/PromoteExperiment)\n\nFor these methods, the API returns a [longrunning\noperation](/google-ads/api/reference/rpc/google.longrunning#google.longrunning.Operation)\nwhich you can use to request details on the status of the asynchronous\noperation. Upon completion, the longrunning operation will populate the `error`\nand `response` fields. In the Google Ads API, the operation will always populate the\n`response` with an `Empty` value, and the presence of `error` will indicate\nthat a full list of errors can be retrieved from another API call.\n\nIf the full list of errors were returned as part of the longrunning operation,\nthen there's a chance the errors might be lost if you don't follow up on the\nasynchronous progress, and the response may be larger than you might expect\nfrom a simple polling request. Therefore, the longrunning operation will only\nindicate that there are errors, and to fetch the specific errors you must use\nan API endpoint.\n\nFor errors relating to any of these experiment-based long running operations,\nuse\n[`ExperimentService.ListExperimentAsyncErrors`](/google-ads/api/reference/rpc/v21/ExperimentService/ListExperimentAsyncErrors).\n\nPass in the resource name of the experiment, and a page size, then page through\nthe results as you would for any other Google Ads API query."]]