AutoMate provides a variety of ways to automatically respond to errors in task steps. These errors can include files or windows not being found at runtime and other more subtle, unexpected conditions that can cause a step to fail. Step level error handling can be set in the properties dialog box of an action. Every action in the available actions library contains two special tabs related to error handling, Error Causes and On Error.
The Error Causes properties allows selection of specific types of errors that will cause the step to fail. The default behavior is to monitor for all errors, however, the properties can be set in order for the step to ignore certain errors or only react to specific errors.
The On Error tab is used to designate how AutoMate should respond to an error. The default behavior is that task execution stops in the immediate step that encounters the error, however, properties can be set to continue to the next step in spite of the error. An assortment of other on error options can be chosen as well (i.e. send email, play a sound, write to log, set variable, etc.).
The Error Causes tab allows the task developer to determine what conditions AutoMate should consider an error for each step. During task execution, if one of these conditions are met, the specified actions in the On Error Tab are carried out. (Properties are illustrated below).
Allows selection of specific types of errors that will cause the step to fail. The default behavior is to monitor for all errors, however, the properties can be set in order for the step to ignore certain errors or only react to specific errors. The available options are:
Any problem encountered during this steps execution will cause the instructions specified in the On Error tab to be carried out.
A list of errors that the step can generate is displayed. Only the selected errors will cause the instructions specified in the On Error tab to be carried out. Non-selected errors are ignored.
The non-selected errors will cause the instructions specified in the On Error tab to be carried out. Selected errors are ignored.
When enabled, this parameter acts as a time-out value for the step. For example, if a SQL Query step is being executed and this value is set to 30 seconds, if the query took longer than 30 seconds to complete, then the step would generate a time-out error and the instructions in the On Error tab would be carried out (disabled by default).
The On Error tab allows the task developer to determine what AutoMate should do if a particular step encounters an error as defined in the Error Causes tab (Properties are illustrated below). Three sections are provided in the On Error properties, each containing its own set of error procedures or actions.
If enabled, this allows the task developer to specify that the step should be retried a chosen number of times along with a chosen amount of time to wait between retries, before actually considering it a true step failure, at which case, the remainder of the error actions will be carried out.
Allows a variety of error actions to be executed. Clicking the Add button opens the dialog box shown below.
The available error actions are:
Starts another task upon error. This action can be used to start a task to rectify the error. In the Task to start field, select the drop-down list of currently available set of tasks.
Sets the value of an existing variable. Can be used to set a variable with the return code. Select the variable in the Variable name box, and enter the value in the Variable value field.
Sends an e-mail upon error. Useful way to alert the proper recipient(s) of the problem. The message will be populated with information about the specific error that occurred and other task information. In the To and From boxes, enter the recipient e-mail address and an e-mail address to be used in the From header. (Many SMTP mail servers require a valid From address.)
plays a specified sound file. In the Sound File box, click the Open Folder button and navigate to the sound file to be played.
Writes the specified message to the Widows Event Log upon error. writes error data to the Windows event log. In the Text box, enter the text to be written to the log.
Writes the specified message to the AutoMate Event Log upon error. Messages can viewed from the Task Administrator by clicking the Log button. In the Text box, enter the text or specify the variable to be written to the log.
Specifies what the step should do in regards to execution directly after the error event occurs.
The available actions are:
Stops the task and initiates task level error handling. This is the default setting.
continues the task in spite of the step error. You can use this option if the error is non-critical or if additional error handling steps are located below this step.
Goes to the specified label. (the label must be created in and earlier step using the Label action.) In the Label box, select the label. If the task has been saved, existing labels appear on the drop-down list.
Specifies that AutoMate should skip to another step in the task. In the Step box, specify the step number to go to.
NOTE: Too many Goto instructions can produce extremely unmanageable tasks. It is usually better to create a separate task and use the Start Task action instead.
Error Handling Overview
Setting Global Error Handling
Automate Event Log