On Error

Description

Determines what AutoMate should do if the step encounters an error as defined in the Error Causes properties. The default behavior is that task execution stops in the immediate step that encounters the error, however, these properties allow you to designate how AutoMate should respond upon the occurrence of an error. For example, a step can send an email, execute another task or log specific text to the Windows Event Log upon error. In addition, a step can be set to continue to the next step in spite of an error.

Practical Usage

Used to control what the task should do upon occurrence of an error.    

NOTE: All On Error properties are optional entries.  

Parameters

Property
Type
Default
Markup
Description

Retry the step x times

Number

(Disabled)

AM_RETRY="6"

Indicates the amount of times execution of this step should be retried if it encounters an error as defined in the Error Causes properties. This property is disabled by default.

Pausing x milliseconds

Number

(Disabled)

AM_RETRYDELAY="3000"

Specifies the amount of milliseconds this step should wait between retries as defined in the Retry the step x times parameter. This property is disabled by default.

Execute the following error actions

Text

(Empty)

a)AM_RUNTASK="Task1"(Start Task)

b)AM_SETVAR="Var1;0"(Set Variable)

c)AM_EMAIL="mm@mycompany.com"(Send Email)

d)AM_WRITETOEVENTLOG="0"(Write to Log)

 

Allows a variety of actions to be executed upon the occurrence of an error. Click Add to add a new error action,  click Modify to edit an existing entry or click Remove to delete an entry. This property is disabled by default. The available options are:

  • Start Task - Starts another task upon error. This action can be used to start a task to rectify the error. In the Task to start drop down, select the desired task.
  • Set Variable - Sets the value of an existing variable upon error. 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.
  • Send E-mail - 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 as well as other important task information.
NOTE: Many SMTP mail servers require a valid From address.
  • Play Sound - Plays the selected sound (.wav) file upon error. In the Sound File box, click the Open Folder button and navigate to the sound file to be played.
  • Write to Windows Event Log - Writes the specified message to the Widows Event Log upon error. In the Text box, enter the text or specify the variable to be written to the log.  
  • Write to Log - Writes the specified message to the AutoMate Event Log upon error. In the Text box, enter the text or specify the variable to be written to the AutoMate log.  

After error event

Text

(Empty)

a)AM_ONERROR="BREAKLOOP"

b)AM_ONERROR="CONTINUE"

Determines what should occur after the occurrence of an error event. The available options are:

  • Stop Task (default) - Execution stops in the immediate step that encounters the error.

  • Continue to next step - Continues task execution to the next step. This option continues the task in spite of the step error. Use this option if the error is non-critical or if additional error handling steps are specified in a subsequent step.

  • Break loop - Breaks out of a loop. If the step is inside a loop, it should stop looping and go to the step (if any) following the End Loop.

  • Goto label - Continues task execution to the label specified. The label must be created in an earlier step using the Label action.

  • Goto step - Continues task execution to the step specified. This allows the task to skip to another step in the task upon error.

NOTE: Too many Goto instructions can produce extremely unmanageable tasks. It is usually better to create a separate task and use Start Task instead.

See Also

Error Handling Overview

Setting Global Error Handling

Automate Event Log