Exception handling questions

Hi all,
i have achieved my Uipath certification last week :grin:
I study a lot and i’m quite confident (for now) about the argument in academy, BUT, i need an help with the exception handling.

For example: in a complex project, every activity must be put inside a try/catch block and eventually throw the exception?
And the retry action, if i put 2 times, in the config file or orchestrator, is valid for every application exception inside the framework? How can i manage that? Need help!

Thanks in advice! :grinning:

Hi @yiroday, the retries in orchestrator queue and framework config file are quite different.

Orchestrator queue:
If a Queue Item fails with application exception the queue puts the status of the item from failed to retried and creates the exact same item as a new item again. If the max. amount of retries is reached it won’t set a new item.

in ReFramework:
The retry in the config file determines the retries of the process transaction state in the state machine independently of the orchestrator queue item retries.

It might helps to look deeper into the set transaction status xaml from the framework. here should be everything declared for retries.

1 Like

Thanks,
i need to understand when i must use the exception handling…
Imagine for example i can do some operation in Process.xaml, navigate to, click, data scraping, and every operations the BOT can do…
I can provide to put every activity inside a try/cath block?

@yiroday I wouldn’t do that.

The process.xaml is already in a try catch that should be enough. If you put every activity in a try catch you need to declare for every failing activity it’s own exception handling. In my opinion that’s way of over engineered :slight_smile:

You can do that for activities which are failing likely often and you want to do some special exception handling but not retrying the whole transaction.

For me i always do it like that:

  • if the screen changed
  • element exists, if condition (with throw if the element does not exists)
  • click on the element
1 Like

Thanks for the reply!
That’s really helpful…

In my case in process i have 6 invoke, with 6 different process, in this 6 invoke imagine i have an attach window, click, get text, if, while, and something like that… My question is: When use try/catch activity? For example, in the attach window? And i provide to retry that specific application?
Thx in advance