Tag: OnError
The OnError
tag sets the way Ytria applications will handle errors encountered while executing automation scripts.
<OnError Continue="True"/>
Tag Attributes
Attributes | Attribute Value | Value Description | Comment |
Continue | True/ False | | Mandatory |
Detailed Description
The OnError
tag can be used either once or multiple times in a script.
Note | This does not have any effect on XML Syntax errors. |
When
Continue is set to
True and an error occurs, the application will jump to the next action in the script and continue running.
When
Continue is set to
False and an error occurs, the application will stop and the current error will be displayed in the dialog box.
The default behavior of applications when they encounter an error in an XML script is equal to
<OnError Continue="False"/>
.
XML Script Example
<?xml version="1.0" encoding="UTF-8"?>
<ytriaAutomation Application="databaseEZ" ApplicationVersion="16.5">
<Load Server="ACME01/ACME"/>
<OnError Continue="True"/>
<Select Database="log.nsf" Select="True"/>
<SelectColumn target="grid" columnID="D1"/>
<OnError Continue="False"/>
</ytriaAutomation>
In the script above,the entire server ACME01/ACME will be loaded into the database selection tree of databaseEZ, the action OnError
states that if the application running the script (in this case databaseEZ) encounters any errors after line <OnError Continue="True"/>
, the script will continue running until the end or, if applicable, the next instance of the OnError tag sets the error handling otherwise <OnError Continue="False"/>
and a subsequent error is encountered. The database "log.nsf" will be selected in the tree and loaded into the main grid. The column with the ID of "D1" will be selected.