Class UserError

UserError

連接器使用者會看見的錯誤。

var cc = DataStudioApp.createCommunityConnector();

cc.newUserError()
  .setText("This is the debug error text.")
  .setDebugText("This text is only shown to admins.")
  .throwException();

方法

方法傳回類型簡短說明
printJson()String列印這個物件的 JSON 表示法。
setDebugText(text)UserError設定偵錯錯誤文字,只會向管理員顯示。
setText(text)UserError設定使用者錯誤訊息的文字。
throwException()void觸發要擲回的例外狀況。

內容詳盡的說明文件

printJson()

列印這個物件的 JSON 表示法。此功能僅適用於偵錯。

回攻員

String


setDebugText(text)

設定偵錯錯誤文字,只會向管理員顯示。

參數

名稱類型說明
textString錯誤訊息文字。

回攻員

UserError:這個物件用於鏈結。


setText(text)

設定使用者錯誤訊息的文字。

參數

名稱類型說明
textString錯誤訊息文字。

回攻員

UserError:這個物件用於鏈結。


throwException()

觸發要擲回的例外狀況。