Exam UiPath-ADAv1 Topic 5 Question 160 Discussion
Actual exam question for UiPath's UiPath-ADAv1 exam
Question #: 160
Topic #: 5
Question #: 160
Topic #: 5
When encountering an ApplicationException, what occurs if the developer chooses InvalidOperationException as the exception handler within the Catches section of the Try Catch activity?


Suggested Answer: B Vote an answer
The Try Catch activity is used to handle errors and exceptions that may occur during the execution of a workflow1. It has three sections: Try, Catches, and Finally1.
The Try section contains the activities that may throw an exception or an error. If an exception or an error occurs, the execution of the Try section is stopped and the control is passed to the Catches section1.
The Catches section contains one or more exception handlers that specify what type of exception or error to catch and what actions to perform when it is caught. The exception handlers are executed in order, from top to bottom, until a matching exception or error is found. If no matching exception or error is found, the execution of the workflow is stopped and a runtime error is thrown1.
The Finally section contains the activities that are always executed at the end of the Try Catch activity, regardless of whether an exception or error occurred or not. The Finally section is used to perform cleanup actions, such as closing applications, releasing resources, or logging messages1.
In your case, you have configured the properties for the Try Catch activity as follows:
The Try section contains a Throw activity with an ApplicationException.
The Catches section contains an InvalidOperationException with a Message Box activity and a Log Message activity.
The Finally section is empty.
This means that the Try Catch activity will throw an ApplicationException in the Try section and look for a matching exception handler in the Catches section. However, since you have chosen InvalidOperationException as the exception handler, which does not match the ApplicationException, the execution of the workflow will be stopped and a runtime error will occur. The Finally section will not be executed.
Therefore, option B is correct.
References: Try Catch - UiPath Documentation Portal.
The Try section contains the activities that may throw an exception or an error. If an exception or an error occurs, the execution of the Try section is stopped and the control is passed to the Catches section1.
The Catches section contains one or more exception handlers that specify what type of exception or error to catch and what actions to perform when it is caught. The exception handlers are executed in order, from top to bottom, until a matching exception or error is found. If no matching exception or error is found, the execution of the workflow is stopped and a runtime error is thrown1.
The Finally section contains the activities that are always executed at the end of the Try Catch activity, regardless of whether an exception or error occurred or not. The Finally section is used to perform cleanup actions, such as closing applications, releasing resources, or logging messages1.
In your case, you have configured the properties for the Try Catch activity as follows:
The Try section contains a Throw activity with an ApplicationException.
The Catches section contains an InvalidOperationException with a Message Box activity and a Log Message activity.
The Finally section is empty.
This means that the Try Catch activity will throw an ApplicationException in the Try section and look for a matching exception handler in the Catches section. However, since you have chosen InvalidOperationException as the exception handler, which does not match the ApplicationException, the execution of the workflow will be stopped and a runtime error will occur. The Finally section will not be executed.
Therefore, option B is correct.
References: Try Catch - UiPath Documentation Portal.
by Boris at Jan 24, 2025, 11:26 AM
0
0
0
10
Comments
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Report Comment
Commenting
You can sign-up / login (it's free).