If your UiPath automation has ever stopped because some file vanished or a selector went rogue, welcome to the club nobody wants to join. Try Catch Finally is your seatbelt for workflows. It catches exceptions, lets you respond like a grown up, and still runs cleanup whether things went well or exploded spectacularly.
Think of Try Catch Finally as the safety net for RPA. Without it your automation will abort on first failure and leave temporary files, open handles, and messy logs behind. With it you can do targeted exception handling, retry transient errors, and always run cleanup steps so your next run does not inherit yesterday's chaos.
Yes this is basic, but that is the point. Follow these steps and your automation will behave better than most coffee machines.
Try Catch
activity from Activities into your Sequence or Flowchart. This creates a container for exception handling.System.IO.IOException
or UiPath.Core.SelectorNotFoundException
. Handle each case with tailored recovery or logging so you are not sweeping real bugs under the rug.Here are a few rules that separate robust automation from scripts that learn new ways to fail.
System.Exception
is a lazy hug that hides real bugs.In a Catch block you might inspect the exception variable, log a meaningful message, and decide whether to retry or escalate. For example use a counter for retries and break out if max attempts are reached. Do not swallow exceptions silently. If you need to rethrow, do so after logging so monitoring systems can pick it up.
Use the UiPath debug tools like the Locals panel, breakpoints, and step execution to see which branch runs. Tail your logs to include activity names and exception messages. Run negative tests that force selector failures or file access errors to confirm your Catch and Finally logic actually runs.
Try Catch Finally is simple but powerful. Place a Try Catch wrapper around risky actions, define specific Catch handlers, and use Finally for guaranteed cleanup. Do that and your RPA projects will be more reliable, maintainable, and slightly less likely to start a mystery incident at 3 a.m.
Keep your logs readable, prefer precise exception types, and add retries for transient issues. Your future teammates and your oncall self will thank you, or at least file fewer angry tickets.
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.