Error Handling
During script execution, errors may occur. These are generally called runtime errors because they occur while the script is running, as opposed to syntax errors, which are detected before a script is run. When a runtime error occurs, it throws an exception. When an exception is not caught, it causes script execution to terminate and an error message to be displayed. The try...catch...end try
control structure allows you to catch these exceptions so your script can handle the error condition in the manner you choose. The throw
command can be used to throw your own exceptions, or to re-throw an exception that you caught.