Tag: OnError
A script from another file/job or from a variable in the current script can be executed when an error occurs.
Tag Attributes
|
Attributes |
Attribute Values |
Value Description |
|---|---|---|
|
User Definable |
The external script file path and name to be used. |
|
|
User Definable |
The variable to be used. NB: here the variable name must be used without the variable syntax {% and %} <OnError ExecuteVar=”VarName”/> is OK <OnError ExecuteVar=”{%VarName%}”/> is NOT OK |
Continue can be combined with MsgBox, Execute or ExecuteVar. If Continue is set to True, the script goes on after the error.
If several of MsgBox, Execute and ExecuteVar are set, only one runs, by priority: ExecuteVar first, then Execute, then MsgBox.
When set in an OnError action, Execute and ExecuteVar indicate which automation directives to run everytime an error is met. The error actually triggers a regular Execute / ExecuteVar call.
Example Script
<ytriaAutomation>
starts onerror-dlg.xml upon error:
<OnError Execute="onerror-dlg.xml"/>
starts the XML contained in MyVar upon error:
<OnError ExecuteVar="MyVar"/>
displays a message box upon error:
<OnError MsgBox="ERROR"/>
all options can be set at once, but only one handler runs (ExecuteVar, else Execute, else MsgBox):
<OnError ExecuteVar="MyVar" Execute="onerror-dlg.xml" Continue="true" MsgBox="ERROR"/>
<SetVar MyVar="USE_CDATA" BypassVar="true">
<![CDATA[ <SetVar Error1="ERROR 1"/>
<MsgBox Message="Error {%error1%} {%Error2%}!"/>]]>
</SetVar>
<SetVar error2="ERROR 2"/>
triggers error:
<UnSelect/>
<MsgBox Message="THE END"/>
</ytriaAutomation>