Skip to main content
Skip table of contents

SetError: trigger an error (throw an error)

Tag: SetError

SetError allows to put the current script/job in error mode. It might be useful to manage situations where a script encounters a dead end without the automation engine to be in error.

If an OnError procedure was set earlier in the script, it is triggered by SetError. Otherwise the default error processing is triggered.

The text from SetError can then be found via the system variable {%LastError%}. It is also set as a system error and can be retrieved using SetVarListErrorSystem.

Tag Attributes

Attributes

Attribute Values

Value Description

Text

User Definable

The error message to set in the system.

Not required, Can remain empty (in that case a warning is issued upon script load).

Example Script

XML
<ytriaAutomation>

	<OnError continue="true" ExecuteVar="MyError"/>
	...
	<SetVar MyError="USE_CDATA" BypassVar="true">
		<![CDATA[	<MsgBox Message="Error {%LastError%}!"/>]]>
	</SetVar>
	
	<SetError Text="An error was thrown"/>
		
</ytriaAutomation>

JavaScript errors detected

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

If this problem persists, please contact our support.