Stay organized with collections
Save and categorize content based on your preferences.
UserError
An error that is shown to users of the connector.
constcc=DataStudioApp.createCommunityConnector();cc.newUserError().setText('This is the debug error text.').setDebugText('This text is only shown to admins.').throwException();
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-02 UTC."],[[["`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"]]