Support Import

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 Robot is running. It is also known as a Run-Time Error. The default response of ProcessRobot to Exceptions is to fail that Process. However, other options are also allowed. By going into the Exception Handling tab of an Action's Properties, you can specify how the Action will handle an exception.

exception handling.png

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.     Then all the exception that this specific action can throw are listed in the "Exception(s) thrown by this action" list. By clicking on a specific exception, you can specify how this exception will be handled.

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

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 behavior to one specific exception, you can click on another one to select a different behavior. Thus, the Action could handle three different exceptions in three different ways after retrying X times.

It is very important, that you can select from a variety of 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 send an email to a contact about the Processes' failure.

Moreover, the user can set the Process to run a function after the exception occurs in order to complete part of the task or to notify an interested party. Also, the user can set the Process to proceed with the execution from another point of the Process.  

Please note, that you can do the above for 'All Exceptions' [2] or set them in any way you want according to a 'Selected Exception' [3] thrown by this action.

exception handling2.png

Notice that all the exceptions that have some custom Exception handling rules assigned, are displayed in bold (as you can see in the first screen-shot above [1]). Exceptions that will immediately cause the Process to fail (the default behavior) are displayed in normal text.Exception Handling is different from the Error Handling Tab in the Console as Error Handling is what ProcessRobot 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.Error Handling