I would like to use try catch activity so that if I get any ANY error during my automation process I want it to restart the whole thing. (to start automation from start to finish again if the error is encountered)
How do I use it?
What do I put in the “TRY” window? should I put all of my workflow there?
Then in CATCH should I choose every type of errors?
@chowus Hi
As a beginner, using the Try Catch activity in UiPath is a good practice to handle errors and control the flow of your automation. Here’s how you can use it:
Drag and drop the Try Catch activity into your workflow.
Inside the Try block, you should place the activities that you want to execute without any expected errors. This can be your entire workflow or specific activities that you anticipate might throw an error.
In the Catch block, you can specify the type of exception you want to catch. To catch all types of exceptions, you can use the “System.Exception” type. You can also choose specific types of exceptions based on your requirements.
Inside the Catch block, you can include activities to handle the error, log the error message, or take any necessary actions. For example, you can use the Log Message activity to write the exception message to the output panel or send an email notification.
If you want to restart the whole automation process when an error occurs, you can place the entire automation workflow or the starting point of your automation process in the Re Try block activity.
In the Finally block, you can add activities that you want to execute regardless of whether an error occurred or not. This can include cleanup activities or final steps to be performed.
A Try Catch isn’t the way to do this. You should have your process built as a Flowchart and then you can loop back to the beginning if there is an error.