Hi… I have used web recording to do some automation. i have used click activities mostly. So can you suggest some better approach for handle the automation. What will I do In catch block? Please suggest some better handling
It depends on what you need when an exception occurs and what type of exception it is
generally it might fail due to website hanged then you can use retry scope instead of try catch
cheers
Hi
Hope the below suggestion would help you
Usually exception handling can be done by set of activities like
Try catch
Retry scope
Throw
Re throw
Global exception handler
Terminate workflow
Let’s see how u can use in right place
-
In your workflow with sequence of activities you have if there is any activity that could possibly fail or needs a retry then surround that particular activity with RETRY SCOPE if you want to retry the same activity to some number of times
You can mention the number of times in property panel so that it repeats that much number of time
You can keep the activity you want to retry in action block and any conditional activity like Element exists, image exists in condition block
If you don’t have any condition to have you can keep that condition block empty and have only in action block -
If you don’t want to retry the same activity again and again you can surround that with Try catch activity where keep the activity that might fail inside the try block so that if it throws error it goes to catch block
-
Inside the catch block you can even throw that exception with your own exception message using THROW activity
Put like New Exception(“your own exception message”) in throw activity -
If you just want to ReThrow that error somewhere you can use RETHROW activity
-
Global exception handler can be used in your project level if you are not sure on where the exception can occur
https://docs.uipath.com/studio/standalone/2023.4/user-guide/global-exception-handler
- Terminate workflow is to terminate the process itself if you want to stop the bot on any exception occurrence
I can share the academy link to learn about these activities
Hope u know got some idea on where to use and how to use exception activity
Cheers @Srinivas_Billalavalasa
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.