有兴趣分享您对 Google Ads API 的反馈吗?
注册即可获邀参与用户调研!
异步错误
由于 ExperimentService
包含一些异步操作,因此获取与这些操作相关的错误的机制不同于其他同步操作。
使用此错误报告机制的异步操作包括:
对于这些方法,API 会返回一个长时间运行的操作,您可以使用该操作来请求异步操作的状态详情。完成后,长时间运行的操作将填充 error
和 response
字段。在 Google Ads API 中,该操作将始终使用 Empty
值填充 response
,并且存在 error
表示可以从另一 API 调用检索完整的错误列表。
如果在长时间运行的操作中返回了完整的错误列表,且没有对异步进度进行跟进,错误可能会丢失,且响应值可能比简单轮询请求预期的要大。因此,这个长时间运行的操作只会指出存在错误,要提取特定的错误,您必须使用 API 端点。
对于与基于实验的任何长时间运行的操作相关的错误,请使用 ExperimentService.ListExperimentAsyncErrors
。
传入实验的资源名称以及页面大小,然后像浏览任何其他 Google Ads API 查询一样浏览结果。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-02-28。
[null,null,["最后更新时间 (UTC):2025-02-28。"],[[["The `ExperimentService` uses a different error reporting mechanism for its asynchronous operations like scheduling and promoting experiments."],["Asynchronous operations return a longrunning operation; check its `error` field to see if errors occurred during the operation."],["To retrieve the full list of errors for an asynchronous experiment operation, use the `ExperimentService.ListExperimentAsyncErrors` method with the experiment's resource name."],["Instead of including all errors in the initial response, this approach prevents potential data loss and keeps response sizes manageable."]]],[]]