Error Doesn't Go Into Try Catch, Process Just Stops

Hi everyone,

I created an automation that runs a daily report:
It gets data from a website (opened in Chrome), processes it using Excel and an Invoke VBA macro, and finally sends the result to Telegram.

Recently, during my thesis defense, my lecturer asked me to add a feature that sends a notification to Telegram if the process fails at any point.

To do this, I added a Try Catch block, and inside the Catch I placed an HTTP Request to send the error message to Telegram.

Then I tested it by intentionally causing an error, like removing the target element in a Type Into activity.

But what happens is:

  • The process just stops or freezes
  • It doesn’t go into the Catch block
  • So nothing gets sent to Telegram
  • And the process doesn’t reach the End — it just hangs there

I only used basic Try Catch. I didn’t change any other properties (like Input Mode, Verify typed text, etc.) because my workflow is already finalized and I don’t want to change the existing structure.

:magnifying_glass_tilted_left: My question is:

How can I make sure that any error, no matter where it happens (e.g. web interaction or Excel), is properly caught by Try Catch, so the bot can continue and send a failure notification?

Thanks a lot in advance :folded_hands:

@nashwasabila11,

Try running the code instead of debugging.
Also try upgrading the UiPath.System.Activities package to latest possible version.

Hi @nashwasabila11

Are you running or debugging the code?

If debugging, process stops right when exception is encountered.

While debugging, please enable execution trail from debug menu. That will allow you to properly see what activity, workflow is stopping/freezing.

Also, to test try catch functionality, you would need to RUN your code. During run mode, if exception occurs, it will be caught by catch block.

Additionally, please verify if you have enabled catch block and catching system/application/exception? It should not be empty catch block.

@nashwasabila11

First check about debug..if you see continue on top till you click it it would not move forward

Also are you on studioX because if so it has global exception handler first

Cheers

Hi @nashwasabila11 can you share snapshot of your catch block

Hi @nashwasabila11

Please try to debug the code as well wherever sequence you are passing try catch use breakpoints, check the Ui element selector in “try” if you are using type into try different activity it if is not working like example: set text activity.

Hope this solution works for you!

Hi @nashwasabila11
Could you please check if the “Continue on Error” option is enabled? Also, could you share a screenshot of the Catch block for better understanding?

@nashwasabila11

  1. Mode of running process- Are you running process in debug mode then process stops. you need to click on continue then it will go to catch block.
  2. Check if project contains global exception handler. Remove that if its not useful in your case.
  3. If issue still persists, try updating UiPath.System.Activities package to latest version.

Hi,
It works!! :tada:
Thank you so much for the simple but super helpful suggestion. I changed from Debug to Run mode and updated the UiPath.System.Activities package — and now the Catch block works exactly as expected!

I really appreciate your help :folded_hands:

1 Like

Thank you so much for the detailed explanation! :folded_hands:
You’re absolutely right — I was debugging the code, and that’s why the Catch block wasn’t working. After switching to Run mode and making sure the Catch is properly set up, everything worked perfectly!

Really appreciate you taking the time to explain it clearly. Thanks again! :blush:

1 Like

Thanks a lot for the tips! :folded_hands:
Yes, I was running it in Debug mode — and I didn’t realize I needed to hit “Continue” to proceed. Switching to Run mode really helped, and now the Catch block works properly.

Also, I’m using Studio (not StudioX), but I really appreciate the heads-up about the global exception handler — will keep that in mind moving forward.

Thanks again! :blush:

1 Like

Thank you so much for the suggestions! :folded_hands:
I’ll definitely try using breakpoints to better trace the flow, and also experiment with alternative activities like Set Text as you mentioned.

Really appreciate your help and the thoughtful advice. Thanks you! :blush:

1 Like

Thanks a lot for the detailed advice! :folded_hands:
Yes — I was running it in Debug mode, and I didn’t realize that I needed to click Continue. After switching to Run mode and updating the UiPath.System.Activities package, everything started working properly.

Also checked the Global Exception Handler just to be sure — turns out I didn’t need it in my case.

Really appreciate the support and guidance. Thanks again! :blush:

1 Like

Thanks for the follow-up! :folded_hands:
I actually didn’t have “Continue on Error” enabled, but that’s a great point to double-check. The issue turned out to be that I was running in Debug mode, and switching to Run mode solved the problem — now the Catch block is triggered correctly!

Really appreciate your help and willingness to look into it! :blush:

Thanks for checking in! :folded_hands:
The issue is resolved now — it was because I was running the process in Debug mode. After switching to Run mode, the Catch block started working as expected!

But I really appreciate your offer to help — if it hadn’t worked, I would’ve definitely shared the snapshot.

Thanks again! :blush:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.