Skip to main content
Skip table of contents

OnError: Execute script upon error

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


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, MsgBox, Execute and ExecuteVar are not mutually exclusive.

When a combination is set, the sequence is:

  1. MsgBox

  2. Execute

  3. ExecuteVar

  4. If continue is set to True, the script then goes on.

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


    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:
	<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 error2="ERROR 2"/>
	triggers error:
	<MsgBox Message="THE END"/>
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.