When building applications with Twidget, you may encounter situations where you need to handle errors gracefully to ensure your application runs smoothly. Twidget provides two powerful commands for error handling: try-catch
and throw-error
. This documentation will guide you on how to use these commands effectively.
-
try-catch
The try-catch
command is used to handle exceptions that may occur during the execution of your application. This command allows you to execute a block of commands (try
block) and provide a mechanism to handle any exceptions (catch
block).
The try block will automatically create an error variable, this variable holds the error message and sometimes other information.
Optionally, you can include a finally
block to execute code regardless of whether an exception was thrown or not.
throw-error
The throw-error
command is used to explicitly throw an error in your application. This can be useful if you want to enforce certain conditions and notify that something went wrong when those conditions are not met.
try-catch
: A command to handle exceptions, execute commands conditionally on error, and optionally run final commands regardless of error outcome.
throw-error
: A command to explicitly throw an error, which can then be caught and handled using try-catch
.
By utilizing these error commands, you can ensure your Twidget application handles errors gracefully and continues to provide a smooth user experience.
Date
Twidget offers a variety of commands to manipulate date objects. Below are the available commands along with their respective descriptions, inputs, and outputs. Current Date. Description: Returns the current date and time. Output: - Type: DATE Add Time. Description: Returns the date plus a specified...
Miscellaneous
Twidget provides several miscellaneous commands to facilitate various tasks. Is Null. Description: Checks whether the provided value is null or not. Inputs: - value: The value to be checked. Output: - boolean: Returns `true` if the value is null; otherwise, returns `false`. Not Null. Description: Ch...
Send External HTTP Request
Using Twidget, you can send external HTTP requests effortlessly. This functionality allows you to communicate with external servers or APIs. Below, you will find the necessary parameters and structure to set up an HTTP request. Parameters. - URL: The endpoint to which the request will be sent. - Met...
Math
Twidget offers a variety of commands to manipulate numbers. Below are the math commands available, along with their descriptions, inputs, and outputs. Sum. Description: Adds together a list of numbers and returns the sum. - Inputs: - `numbers`: A list of numbers to be added together. - Output: A sin...
Variables
Variables are essential building blocks in Twidget that allow you to store and manipulate data dynamically within your no-code applications. They enable you to create flexible and interactive applications by holding values that can be changed and referenced throughout your workflow. Creating Variabl...