How to catch system error and restart the whole process again?

I want my robot to start from the beginning (open the browser, type username, and password, click certain things, type, select and submit stuff like these) in a case of system error in UiPath. How can I make sure my workflow works like that? I used try-catch and inside catch I have tried to attach the browser and then close the window but it doesn’t catch error. The problem is there can be various errors and it’s not possible to use many try-catch. So, in a case of those error I want my browser to get closed and the workflow starts from the beginning

Hi @Samraat_Maharjan

for those cases we can use state machines or reframework template,
Main.xaml (13.1 KB)

Here is a template how to use that

Regards

1 Like

Thank you for your reply. However, I didn’t understand these terms (exit, transition, exception occupation, destination). Is this inbuilt activity? If so then I couldn’t find it inside the activity panel.
Screenshot_1357

@Samraat_Maharjan
As we all know, we can use next Try-Catch but as you mentioned you don’t use one by one.
I have a suggestion for it.

  1. please whole code in Try Block.
  2. In Catch block select system exception and throw an error.
  3. enclose these all things with Retry scope

Step1: Try Catch Part:

Retry Scope Part:

Hi @Samraat_Maharjan

Entry part is to have the activities or workflow you can have in side try catch and if there is any exception then it will go to catch part and in catch part you can decide on transitions like if there is a exception then which workflow the bot need to execute.
After successful execution of Entry part bot comes to Exit part

thank you

Hey @Samraat_Maharjan

I would highly recommend using the Robotic Enterprise Framework.

You can throw a System Exception and the framework will handle the rest.

Cheers

Steve

1 Like

Hi @Steven_McKeering thanks for sharing.

1 Like

Tips to fix-

Switch to Windows Default Theme.
Reset Windows Store Cache.
Use Check Disk Utility Tool.
Repair System Files Using DISM.
Run Virus or Malware Scan.

Regards,
Rachel Gomez