|Bookshelf Home | Contents | Index | PDF|
The try statement is used to handle functions that may raise exceptions, which are error conditions that cause the script to branch to a different routine. A try statement generally includes a catch clause or a finally clause, and may include both. The catch clause is used to handle the exception. To raise an exception, use the throw statement (see throw Statement).
When you want to trap potential errors generated by a block of code, place that code in a try statement, and follow the try statement with a catch statement. The catch statement is used to process the exceptions that may occur in the manner you specify in the exception_handling_block.
The finally clause is used for code that should always be executed before exiting the try statement, regardless of whether the catch clause halts the execution of the script. Statements in the finally clause are skipped only if the finally clause redirects the flow of control to another part of the script. The finally statement can be exited by a goto, throw, or return statement.
|Siebel eScript Language Reference|