Share this page

# Error Handling

You can specify how to handle errors during script execution. By default, when the script detects an error, it exits. To continue script execution, even when errors occur, select the Continue on Error check box in VuGen's General runtime settings.

To control error handling for a specific segment of the script, insert an lr_continue_on_error statement before and after the desired segment. The new setting is used until the end of the script execution or until another lr_continue_on_error statement is issued.

For example, if you enable the Continue on Error runtime setting and an error is encountered during replay of the following segment, execution.

lrd_stmt(Csr1, "select..."...);

lrd_exec(...);

To continue on error for the entire script except for one segment, enable the Continue on Error setting, and then enclose the segment with lr_continue_on_error statements.

lr_continue_on_error (0);

lrd_stmt(Csr1, "select..."...);

lrd_exec(...);

lr_continue_on_error(1);

In addition to the lr_continue_on_error statements, you can control error handling using Error Severity Levels.

lr_continue_on_error statements detect all types of errors—database related, invalid parameters, etc. If you want to terminate execution only when a database operation error occurs (Error Code 2009), you can set a function's severity level. All functions that perform a database operation use severity levels, indicated by the function's final parameter, miDBErrorSeverity.

Note: When you enable the Runtime setting: Continue on Error, it overrides the "0" severity level parameter. However, if you clear the Continue on Error check box but you specify a severity level of "1", script execution continues when a database error occurs.

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: