Tech Tip: Sending an Error Message to the Web User
PRODUCT: Qodly Studio | VERSION: 21 | PLATFORM: Mac & Win
Published On: February 10, 2026
When developing a Qodly Studio application, sometimes the user needs to be alerted with an error message. One way to do this is to use the Web Form.setError() method. For example, from a login page, the user enters a password that is sent to the following code for verification:
If the password is incorrect, the user will be shown an error message message on the page:

Another way to send the error message is to use the throw() command:
Similar to above, the user will be displayed the same error message. Note that Web Form.setError() does not stop code execution, while throw() does, including execution of subsequent actions in the chain of events. In a scenario where the current action needs to be ended after sending an error message, but subsequent actions need to be allowed to execute, Web Form.setError() can be paired with a return statement.
| If (Verify password hash($password; $user.password)) Session.setPrivileges("client") Else Web Form.setError("Password incorrect for username.") End if |
If the password is incorrect, the user will be shown an error message message on the page:

Another way to send the error message is to use the throw() command:
| If (Verify password hash($password; $user.password)) Session.setPrivileges("client") Else throw(0; "Password incorrect for username.") End if |
Similar to above, the user will be displayed the same error message. Note that Web Form.setError() does not stop code execution, while throw() does, including execution of subsequent actions in the chain of events. In a scenario where the current action needs to be ended after sending an error message, but subsequent actions need to be allowed to execute, Web Form.setError() can be paired with a return statement.