UiPath-ADPv1 Advanced Debugging Practice Question
Which TWO of the following are best practices when using the 'Try Catch' activity for robust error handling?
⚠ Common exam trap
Candidates often catch generic 'Exception' types for all errors and omit the Finally block, leading to unreleased resources and unhandled specific failures.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use specific exception types for different catch blocks.
Try Catch is the cornerstone of defensive automation. By using specific exception types, you ensure that the robot reacts appropriately to different kinds of failures (e.g., catching a 'SelectorNotFoundException' differently from a 'SystemException'). Including a 'Finally' block is equally important, as it guarantees that critical cleanup tasks like closing browser instances or releasing file locks are always performed, regardless of whether the process succeeded or crashed.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use a generic 'System.Exception' for every catch block.
Why it's wrong here
Catching only generic exceptions is a bad practice. It prevents the robot from handling specific issues in a tailored way. You should always catch the most specific exception type possible (e.g., 'BusinessRuleException') to provide granular error handling and meaningful recovery steps for different types of process failures.
- ✓
Use specific exception types for different catch blocks.
Why this is correct
Specific exception types allow for targeted recovery logic. For example, if a file is missing, you might want to log a warning, whereas if a system is down, you might want to trigger a full process retry. This granular approach makes the automation significantly more resilient to varied error conditions.
- ✓
Include a 'Finally' block to perform cleanup activities.
Why this is correct
The 'Finally' block is essential for resource management. It ensures that regardless of success or failure, resources like temporary files, database connections, or browser instances are correctly closed. This prevents downstream issues like locked files or hung processes that would occur if the code exited prematurely during an error.
- ✗
Always leave the 'Exception' variable empty to hide errors.
Why it's wrong here
Hiding errors is the opposite of good debugging practice. If an exception occurs, it must be captured and logged so the developer can understand what went wrong. Emptying the exception variable makes the process impossible to monitor, troubleshoot, or improve, leading to long-term maintenance nightmares for the automation.
- ✗
Place the Try Catch activity inside every single activity.
Why it's wrong here
Over-using Try Catch creates 'spaghetti code' that is difficult to read and maintain. It is best practice to wrap logical blocks of activities in a Try Catch, rather than individual ones. This keeps the workflow clean while still providing comprehensive coverage for the entire process flow.
About these practice questions
This UiPath-ADPv1 question is part of Courseiva's 276-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official UiPath exam blueprint
This UiPath-ADPv1 practice question is part of Courseiva's free UiPath certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the UiPath-ADPv1 exam.