Lỗi không đồng bộ
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
VìExperimentService
chứa một số
thao tác không đồng bộ, nên cơ chế tìm nạp lỗi liên quan đến các toán tử này khác với các toán tử đồng bộ khác.
Các toán tử không đồng bộ sử dụng cơ chế báo cáo lỗi này:
Đối với các phương thức này, API sẽ trả về một thao tác lâu dài mà bạn có thể sử dụng để yêu cầu thông tin chi tiết về trạng thái của toán tử không đồng bộ. Sau khi hoàn thành, thao tác chạy trong thời gian dài sẽ điền sẵn các trường error
và response
. Trong API Google Ads, thao tác sẽ luôn điền giá trị Empty
vào response
, và sự hiện diện của error
sẽ cho biết rằng danh sách lỗi đầy đủ có thể được truy xuất từ một lệnh gọi API khác.
Nếu toàn bộ danh sách lỗi được trả về trong quá trình chạy trong thời gian dài, thì có khả năng lỗi sẽ bị mất nếu bạn không theo dõi tiến trình không đồng bộ và phản hồi có thể lớn hơn dự kiến từ một yêu cầu thăm dò đơn giản. Do đó, thao tác chạy trong thời gian dài sẽ chỉ chỉ ra rằng có lỗi và để tìm nạp các lỗi cụ thể, bạn phải sử dụng một điểm cuối API.
Đối với lỗi liên quan đến mọi hoạt động diễn ra trong thời gian dài dựa trên thử nghiệm này, hãy sử dụng ExperimentService.ListExperimentAsyncErrors
.
Truyền tên tài nguyên của thử nghiệm và kích thước trang, sau đó chuyển trang qua các kết quả như bình thường cho mọi truy vấn API Google Ads khác.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-26 UTC."],[[["\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."]]