Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
Class UserError
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
UserError
向连接器的用户显示的错误。
const cc = DataStudioApp.createCommunityConnector();
cc.newUserError()
.setText('This is the debug error text.')
.setDebugText('This text is only shown to admins.')
.throwException();
详细文档
printJson()
输出此对象的 JSON 表示法。此方法仅用于调试。
返回
String
setDebugText(text)
设置调试错误的文本,该文本仅向管理员显示。
参数
返回
UserError - 此对象,用于链式调用。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2026-04-13。
[null,null,["最后更新时间 (UTC):2026-04-13。"],[],["The `UserError` class allows developers to create and manage errors displayed to users of a data connector. Key actions include setting the user-facing error message using `setText()`, setting a separate admin-only debug message with `setDebugText()`, and triggering the error to be thrown using `throwException()`. The `printJson()` function outputs a JSON representation for debugging. Both `setText` and `setDebugText` can be chained.\n"]]