We have a project where the designed bot is intended to go to a website and scrape some data. We are using get text activity to scrape the data. The entire project is built using ReFramework. I have 3 Get Text activity within the workflow. I’m trying to use Try-Catch around this.
Scenario1:
When I run this workflow with Try-Catch bot still throws an error when selector for the Get Text activity is not found.
Scenario2:
If I use Try-Catch for each Get Text activity individually then the try-catch works. It catches the exception and finally part is executed.
Scenario3:
If copy the workflow to a different location out of that project folder than the try-catch works have all the 3 Get Text activity within the same Try-Catch.
But i would prefer the first one which is the correct method to add a try catch as a whole rather to individual get text activity
–kindly use SYSTEM.EXCEPTION in the exception dropdown in the catch block and try once, The reason is it will take all kind of common exception, that includes selector issue as well
–but make sure that using catch is not only to find the exception, we need to get back to the process from the beginning to be executed again. if it loses again then we can let the users that we got errored out
–so in the catch block if any exception occurs, use a log message in the beginning to help us debug whether we are in catch block or not by mentioning “Process failed unfortunately at :” + Exception.Source + " due to the :" Exception.message
this will let us know the reason behind and at what activity we faced the error while debugging
and next to this place the complete sequence that we have in the try block so that it will try to execute the same process again from the beginning
–use kill process with required process names mentioned if needed
Kindly try that once and let know for any queries or clarification
Cheers @ashoks93
No unfortunately I can’t share the XAML file as it has sensitive data. But I will see if I can replicate the workflow with sample data but it will take some time.
Strange… Are your Try Catch statement inside of any another sequence ~ workflow? Perhaps your code are runnning but is not reaching try catch point due some error before
Hello, first I’d like to point out that my question about sharing files was not with reference or mandatory ordering, being optional sharing (according to the forum rule that is very clear and accessible to everyone, in addition to what Clayton Claimed). This was only so that other contributors to the forum besides Clayton, could also have a clearer view of the need and help you, anyway I’m glad you understood =).
Second, I gave an edited and tested your Reframework XAML using the 2 try catch in Process and worked perfectly (assigns a log with the exception) and also created a BusinessRuleException only.
I’m attaching the last file I’ve tested ~ edited, take a look and see if the try catch are performed (enter strings in the input boxes) ProcessCHANGEDKOTINDA.xaml (12.6 KB)
Thanks the xaml file @Felipe_Kotinda! Can you please compress and upload the entire project as I sent you. As I previously mentioned If we copy the process.xaml file to a different folder and execute it is executing as expected but if we are executing it within the project then try catch stops working.