You may use the function error in your programs to signal errors. Your error message will appear on the screen and execution will be stopped.
The function try can be used to catch an error before execution is stopped and to continue or to try something else.