Try Catch Activity
The Try Catch activity is UiPath's primary scoped exception handling mechanism.
- Try block — the activities you want to protect from unhandled exceptions
- Catches block — specific exception types to catch: System.Exception, BusinessRuleException, SelectorNotFoundException, ImageNotFoundException
- Finally block — always-executed cleanup (closing files, logging, resetting state)
- Nested Try Catch — inner catches for specific activities, outer catch for workflow-level recovery
- Re-throw pattern — catching, logging, and re-throwing for upstream handling
- Exception message extraction — using exception.Message and exception.Source for structured logging
Retry Scope Activity
Retry Scope provides automatic retry for flaky activities without requiring explicit exception handling code.
- Action section — the activity or sequence to retry on failure
- Condition section — the Check App State or other condition that must be true to stop retrying
- NumberOfRetries property — how many times to retry before throwing the exception
- RetryInterval property — wait time between retries
- Ideal use cases — selector instability, network flakiness, UI load timing issues
- Retry Scope vs Try Catch — Retry Scope for transient failures, Try Catch for business logic exceptions
Check App State Activity
Check App State verifies the UI is in the expected state before proceeding — essential for selector-dependent automation.
- Target element — the UI element that indicates the expected application state
- WaitForReady property — ensuring the element is interactive, not just visible
- Timeout configuration — how long to wait before declaring state not reached
- Usage inside Retry Scope — Check App State as the Condition that stops retrying
- Usage for navigation validation — confirming page loads, modal appearances, element readiness
- Fallback strategy — what to do when Check App State fails after max retries
Business vs System Exception Classification
Correct exception classification determines retry behavior and failure reporting in REFramework.
- BusinessRuleException — expected, data-driven failure; throw when business validation fails (invalid record, missing required field, out-of-range value)
- System.Exception (ApplicationException) — unexpected, infrastructure failure; selector not found, app crashed, network error
- Classification design — business rules that determine BusinessRuleException at the process level
- REFramework integration — BusinessException → no retry, ApplicationException → retry up to MaxRetryNumber
- Custom exception types — extending Exception for domain-specific failure categorization
- Exception hierarchy — catching specific exception types before generic System.Exception
Global Exception Handler
The Global Exception Handler provides a last-resort fallback for exceptions not caught by any Try Catch in the workflow.
- Global Exception Handler workflow — set in Project Settings, receives all uncaught exceptions
- ErrorInfo object — exception type, message, and the activity that threw it
- Action variable — setting to Retry, Ignore, Abort, or Continue
- Logging pattern — always log exception details in Global Exception Handler
- Screenshot capture in Global Exception Handler for production diagnostics
- Interaction with REFramework — Global Exception Handler vs REFramework's own exception handling
Frequently Asked Questions
What UiPath exception handling support do you provide?
We provide real-time support for Try Catch design, Retry Scope configuration, Check App State usage, business vs system exception classification, Global Exception Handler implementation, and production bot recovery patterns. We also provide proxy interview support for exception handling scenario questions.
When should I use Retry Scope vs Try Catch?
Retry Scope is ideal for transient failures — selector instability, UI load timing, network flakiness — where the same activity should automatically retry with a condition check. Try Catch is for business logic exceptions where you need to capture the exception, log it, perform cleanup, and potentially re-throw or handle differently based on exception type.
How does exception handling work in REFramework?
REFramework has a specific exception handling pattern: BusinessRuleException thrown in Process Transaction marks the queue item as BusinessException (no retry). Any other System.Exception triggers the ApplicationException path — Orchestrator retries the item up to MaxRetryNumber, with a re-Init step before each retry to restore application state. We help implement this correctly for your specific business process.
Can you help with production bot instability caused by exception handling issues?
Yes. Production exception handling support includes analyzing failure patterns, identifying misclassified exceptions, fixing Retry Scope configurations, implementing missing Check App State validations, and adding Global Exception Handler logging for better production diagnostics.
Ready to get real-time expert support?
Same-day start. Confidential. All major time zones covered.