Class 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
:這個物件用於鏈結。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-12-22 (世界標準時間)。
[null,null,["上次更新時間:2024-12-22 (世界標準時間)。"],[[["`UserError` is a class representing errors displayed to users of a connector in DataStudio."],["This class provides methods to set user-facing error messages and debug messages for administrators."],["`UserError` includes a `throwException()` method to trigger the error, halting execution."],["Methods like `setText()` and `setDebugText()` facilitate customization of error messages, supporting both user and admin perspectives."]]],["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"]]