Error asinkron
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Karena ExperimentService
berisi beberapa
operasi asinkron, mekanisme untuk mengambil error yang terkait dengan
operasi ini berbeda dari operasi sinkron lainnya.
Operasi asinkron yang menggunakan mekanisme pelaporan error ini adalah:
Untuk metode ini, API akan menampilkan operasi yang berjalan lama yang dapat Anda gunakan untuk meminta detail tentang status operasi asinkron. Setelah selesai, operasi yang berjalan lama akan mengisi kolom error
dan response
. Di Google Ads API, operasi akan selalu mengisi
response
dengan nilai Empty
, dan adanya error
akan menunjukkan
bahwa daftar lengkap error dapat diambil dari panggilan API lain.
Jika daftar lengkap error ditampilkan sebagai bagian dari operasi yang berjalan lama, ada kemungkinan error akan hilang jika Anda tidak menindaklanjuti progres asinkron, dan responsnya mungkin lebih besar daripada yang Anda harapkan dari permintaan polling sederhana. Oleh karena itu, operasi yang berjalan lama hanya akan
menunjukkan bahwa ada error, dan untuk mengambil error tertentu, Anda harus menggunakan
endpoint API.
Untuk error yang terkait dengan operasi lama yang berbasis eksperimen ini, gunakan ExperimentService.ListExperimentAsyncErrors
.
Teruskan nama resource eksperimen dan ukuran halaman, lalu telusuri seluruh hasilnya seperti yang Anda lakukan untuk kueri Google Ads API lainnya.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-09-05 UTC.
[null,null,["Terakhir diperbarui pada 2025-09-05 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."]]