Good evening,
I’m a user of UiPath Studio 2025.0.176STS Community edition.
I have two questions about exception handling.
[Prerequisites]
I’m currently creating a workflow that reads an Excel file, obtains a data table dt, extracts a DataRow variable dr_TransactionItem using the code below, and processes the DataRow variables one at a time.
dr_TransactionItem=dt.Rows(int_TransactionNumber)
The entire Main.xaml is enclosed in a TryCatch activity. If an exception occurs in the Try block, it is caught in the Catch block, where a log is recorded, and the workflow is terminated using the “Terminate Workflow” activity.
[Question 1]
I check whether the INPUT file exists at the beginning of the workflow (see the figure below).
The “Check whether the INPUT file exists” sequence is enclosed in a TryCatch activity.
If an exception occurs in the “Check whether the INPUT file exists” sequence, should I handle the exception in the Catch block of the TryCatch that encloses the “Check whether the INPUT file exists” sequence? Or should I rethrow it in this Catch block and handle the exception in the higher-level Catch block?
[Question 2]
I process one DataRow at a time in the “Process one business item” sequence (see the figure below).
The “Process one business item” sequence is enclosed in a TryCatch activity.
If an exception occurs in the “Process one business item” sequence, I want the workflow to continue running and proceed to process the next DataRow. So, my understanding is that I should handle the exception in the Catch block of the TryCatch that encloses the “Process one business item” sequence, without rethrowing it. Is that correct?
