The script execution tail can be appended to each one of the script execution instructions described in the previous sections. It is used for special error handling.
The on_error:continue clause is used whenever a potential and anticipated runtime error during the execution of the called script should not terminate the execution of the calling script. In such a case the implicitly defined v_program_error_ variable can be used to detect runtime errors and take appropriate actions. See also Chapter 11, Runtime error handling for more information.
Table 20.7. Script execution tail syntax
| Production | Syntax | Links |
|---|---|---|
script_execution_tail |
on_error_clause ?
| the section called “Script execution tail” |
on_error_clause |
"on_error" ":" ( "exit_script" | "continue" )
"remark: default value is |
Example 20.5. Script execution tail examples
service instruction_examples
command script_execution_tail_examples
script
var string result
result = co_error_prone_command // exit immediately if a runtime error occors in co_error_prone_command
result = co_error_prone_command on_error:continue // continue if a runtime error occors in co_error_prone_command
if v_program_error_ #r void then
// appropriate error handling
// ...
end if
end script
end command
command error_prone_command
out result type:string end
script
// some instructions that risk to produce runtime errors
// ...
end script
end command
end service