Customizing error messages
Last updated
Last updated
© 2024 UI Bakery
You might want to create customized error messages that will give your users more clarity about the error. In order to do that, you can use throw new Error
code and customize the message text.
Let's say you would like to throw an error that doesn't allow editing a row in a table on a certain condition. Here's how to do that:
Add the code that will throw an error on a required condition: Code action type - specify the code, e.g.:
If you are using one of the predefined actions (Load Table, Create Row, etc.), then create a multistep action with a code step as a first, and a predefined action as a second step:
2. In the Config section of the action, navigate the Error toast, and refer to the error message as {{actions.yourAction.error.message}}:
Now, anytime the condition is met and the action fails, the user will see a customized error message.