שגיאות אסינכרוניות
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
מכיוון שב-ExperimentService
יש מספר פעולות אסינכרוניות, המנגנון לאחזור השגיאות הקשורות לפעולות האלה שונה מפעולות סינכרוניות אחרות.
הפעולות האסינכרוניות המשתמשות במנגנון זה לדיווח על שגיאות הן:
בשיטות האלה, ה-API מחזיר פעולה ממושכת שבה אפשר להשתמש כדי לבקש פרטים על הסטטוס של הפעולה האסינכרונית. בסיום, הפעולה הוותיקה תאכלס את השדות error
ו-response
. ב-Google Ads API הפעולה תמיד תאוכלס ב-response
עם ערך Empty
, והנוכחות של error
תציין שאפשר לאחזר רשימה מלאה של שגיאות מקריאה אחרת ל-API.
אם רשימת השגיאות המלאה חזרה כחלק מהפעולה השוטפת, יכול להיות שהשגיאות יאבדו אם לא תעקבו אחר ההתקדמות האסינכרונית, והתגובה עשויה להיות גדולה מהצפוי של בקשת סקר פשוטה. כך, הפעולה השוטפת תציין רק שיש שגיאות וכדי לאחזר את השגיאות הספציפיות, צריך להשתמש בנקודת קצה ל-API.
אם אתם צריכים שגיאות שקשורות לפעולות השוטפות שמבוססות על ניסויים, תוכלו להיעזר ב-ExperimentService.ListExperimentAsyncErrors
.
מזינים את שם המשאב של הניסוי וגודל הדף, ולאחר מכן מעיינים בתוצאות כדי לראות את התוצאות של כל שאילתה אחרת ב-Google Ads API.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-09-05 (שעון UTC).
[null,null,["עדכון אחרון: 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."]]