Help files

Exception Handling

Exceptions occur when a Process finds itself in an unexpected situation. For example a "Read Text from File" Action may attempt to read from a file that does not exist while the Process is running. It is also known as a Run-Time Error. The default response of WinAutomation to Exceptions is to fail that Process. However, WinAutomation also allows for other options. By going into the Exception Handling tab of an Action Properties Box, you can specify how the Action will handle an exception.

exception handling.png

In general, there are four responses an Action can have to an exception.

First, by default, it will fail the Action and thus the Process. Next, you could tell it to retry the Action after a specified delay, as many times as you want. For example, you could set the Exception Handling to retry 8 times, once every 5 seconds.Or, by clicking on a specific exception, you could specify how this exception should be handled. The Action could run a different Process and/or continue. If you choose to continue, you can then tell the Action to go to the next action, a specific Label or Function (set to create a certain response to the exception), to set a Variable, that can give you a record of the exception for later Actions or even  repeat that action .Once you have set a response to one specific exception, you can click on another to record a different response. Thus the Action could handle three different exceptions in three different ways after retrying four times.

It is very important, that you can select from a variety of four options in the exception handling. First, you can set another value to a variable and retry the action using the new values of the variable. One more option that the user has, is to run another process upon the exception. For example, a process could be triggered that would email the user that the process failed. Moreover, the user can set the process to run a function after the exception occurs in order to complete part of the task. Last but not least, the user can set the process to proceed with the process execution from another point of the process.  

Please note, that you can do the above for all the exceptions in one action, or alternate them according to the nature of the exception thrown in one action.

exception handling2.png

Note that exceptions that have some custom behavior assigned, are displayed in bold (as you can see in the first screen-shot above). Exceptions that simple cause the Process to fail (the default behavior) are displayed in normal text.Exception Handling is different the Error Handling Tab in the Console as Error Handling is what WinAutomation should do in the event that a Process failed, while Exception Handling is what to do when something unexpected occurs in a specific action so that the Process does not fail.