Skip to main content
Skip table of contents

OnError: Set Script Error Handling

Tag: OnError

The OnError tag sets the way Ytria applications will handle errors encountered while executing automation scripts.

Detailed Description

The OnError tag can be used either once or multiple times in a script.

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"/>.

Tag Attributes

AttributesAttribute ValuesValue Description
ContinueTrue / False

N/A - Required

Example Scripts

<OnError Continue="True"/>

Example Script

	<Load Server="ACME01/ACME"/>
	<OnError Continue="True"/>
	<Select Database="log.nsf" Select="True"/>
	<SelectColumn target="grid" columnID="D1"/>
	<OnError Continue="False"/>

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.

JavaScript errors detected

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

If this problem persists, please contact our support.