Impossible to catch a System.InvalidOperationException exception with Try&Catch activity

Hi there,

I’m using a Pick activity with 4 pick branches inside.
Each of these pick branch activities have a find image activity as trigger.

If any of these 4 pick branch activities fail to trigger, because he image is not visible, then 2 exceptions are triggered: a timeout exception and a System.InvalidOperationException.

I’ve surrounded the pick activity with a try & catch in order to catch these 2 exceptions.
The timeout exceptions is catched, but the InvalidOperationException continues to be triggered. Even with a Try&Catch.

Is there some kind of bug in UiPath Studio?

Or what other way do I have to detect the situations where none of those 4 images are found?

If you dont have any specific action to do corresponding to the type of exception, then use System.Exception. This catches all the exceptions. You may log the exception details from catch block.

I’m also getting System.InvalidOperationException exception while using a On Image Appear activity inside a pick branch. Any idea why this exception is thrown instead of timeout exception?


Any news about this issue. I have same problem with 2018.4.5 that I cannot catch exception (exception base) thrown from pick branch at the first try-catch. Second try-catch is catching those anyway.

Any good ideas? Or known if there is going to be fix for this issue from UiPath side?

Hi @Mikko

Could you try to wrap your activities in each branch in their own Try-Catch? It might help a little, hopefully.

How does one report a bug?
I would say that is definetly a bug…

I moved section with own Workflow and added call of that new workflow into try section. Then try-catch works but not in the same workflow.

Hanki Outlook for Android

Hey, guys! Any news on that?? I am having the same problem but instead of using pick branches I’m using OCR enggines. It seems that it’s not only one error in my case, but I used System.Exception and it’s not working either

@loginerror please report this problem as a bug to be solved for a future release.

Thank you.

Hi @jcob

If you have access to Studio Community Edition, then see here for the easiest way to report bugs starting from 2019.7 :slight_smile:

Any work around for this or recommendation on another activity etc…? Thanks!