How to use Global Exception Handler in process

hello guys,

I have to used global handler in my reframework workflow. please tell me steps.

hiii
@smita.mobifly
Please refer this post.


Hi @monika.c,

How to call global handler in process.

my process: try[ 1.some activity.
2.some activity. |
3. some activity. |error throw
4.some activity. |
]catch[exception]

tell me, where should i mentioned global exception handler i want to run activity 4

There is also a video in Academy showing how to use it. It’s under UiPath 2018.4 updates - Studio:
https://academy.uipath.com/learn/course/561/UiPath20184Updates

4 Likes

As I expriement this feature, I would say this is not a usefull feature in RPA for the repat logic. The problem is, the global exception handler only retry the single Activity, which threw the exception. For example, if you have manuel Throw, this feture will retry only the Throw, not the whole Worflow form beginning. That’s why, I find this feature not mature. Even in the Try-Catch Activity, if the exception occures in the try part, it doesn’t go to the catch part.

1 Like

@Mohammad_Danesh I totally disagree. I have used and implemented many POCs for global handlers. It retries an activity any number of times and a global handler just needs to be present in the project.

If you have a try catch any error in try will most definitely end up in catch without exception (pun intended)

I guess you also have to take a look at the academy video.:slight_smile:

It only work for single activity, if the error happens in Try Block, the Global Handler will catch the Exception and doesn’t let to be handled by Catch after Try.

It does. Please do some research and play around with the conditions. Remove else part of the if condition and it will let the catch part handle your exception. Try it.

No offence, but proclaiming a wrong thing about something being useful or not when it has been developed and tested by the product team is actually a fallacy because anyone trying to implement a retry for every activity will definitely find it useful.

Also,

the above scenario can be controlled by what I explained in the earlier part of my response.

The scenario, which I worked on it, was really simple. A Throw activitvy in a library file and handle it in Process level via try catch, while global handler is also in use. However, global handler caught the Exception instead of the Catch in the Block, although I expected a Rethrow in Catch will send the Exception to the Global Handler.

In the Global Handler, assign result = ErrorAction.continue
If the robot comes to this assign (be it straight through the global handler or via an if statement) the robot will leave the global handler and continue to the next activity, which would be the catch section of a Try Catch if the error occurred inside a try-catch block.

Regards