My bots are frequently crashing due to unexpected UI changes in our legacy ERP system. I am using basic Try-Catch blocks, but it’s becoming tedious to manage them across multiple workflows. Is there a more standardized way to implement a Global Exception Handler that can perform retries or take screenshots before a bot completely terminates?
3 answers
If you are using UiPath, the Robotic Enterprise (RE) Framework is the industry standard for this. it has a built-in state machine that handles Initialization, Get Transaction, Process, and End Process. The "Process" state is wrapped in a Try-Catch that automatically transitions to the "Initialization" state for a retry if a System Exception occurs. This is much better than manual Try-Catch blocks. You should also utilize the "Global Exception Handler" template, which acts as a safety net for any unhandled error. It allows you to define a "Retry" or "Abort" logic globally, and you can easily add code to take a screenshot and save it to a shared folder or Orchestrator bucket for debugging.
Does your ERP system have a slow response time that might be triggering "Timeout" exceptions rather than actual UI element changes?
We started using "Image Recognition" as a fallback when selectors fail due to ERP updates. It increased our bot uptime by 20%.
Sarah is spot on. AI Computer Vision is a game changer for those legacy apps where the selectors change every time the server restarts.
Robert, yes! The ERP hangs during peak hours. How should the bot handle that without failing? You should implement "Dynamic Timeouts." Instead of a hard-coded 30-second wait, use an "Element Exists" activity with a variable delay. Additionally, ensure your "Simulate Type" or "Send Window Messages" properties are enabled, as these are less sensitive to UI focus issues than hardware clicks, making the bot much more resilient to lag.