Cannot catch Exception

Hi, everyone… Im new to UIPATH and im struggling with this exception catch.
I have a Parent WF in which i invoke the child WF surrounded by a Try/Catch Block… When in run it, the exception is not catched.
I ran a few tests. For example, surrounding the “throw” activity with a try catch block and then rethrowing it… It catches it but the parent workflow cannot catch. Also tried different types of exceptions and catching System.Exception.
Nothing works.

Parent (State machine)
image
Child

Also, tried a Global Handler… It nevers reaches its code.

Can you help me?
Thanks

@Eduardo_Cirilli

Please find the sample work flow.
CatchException.zip (13.8 KB)

Remember if you put try-Catch in child workflow then it will be caught in Child WF itself and won’t come to parent block.
so,

Regards,
Ahtesham

Hi and thanks for the quick answer.
I tried the example and the exception FAULTs in the child WF as you explained.
How should i manage this kind of situation. I need to reach the parent WF with the exception and i my example, log and continue with the next iteration (Im iterating in the parent).

THanks

In that case you should continue iterations and If there’s an error, manually throw an exception.

If you are using RE Framework , then just throw your exception as Business Exception then your workflow will not stop and will proceed with next iteration.

please find the snippet for reference.

Regards,
Ahtesham

Hi!, i think i’ve trying to do that BUT in the wrong way. (trying to catch the exception in “process transaction” … )
I must configure the Rule exception flow in some way to catch it…

I’ll try it right now.
Thanks!

Hi again. I’ve been running some tests…
Check this WF:

Trying to access opened workbook:
image
Exception not being catched?:

Why?

THanks in advance.

@Eduardo_Cirilli, just now I saw your post. Definitely I will check this and try to give you some solution tomorrow.

Ahtesham