# About exception handling

**URL:** <https://forum.uipath.com/t/topic/5460752>\
**Category:** フォーラム\
**Created:** [September 22, 2025, 9:50am UTC](https://forum.uipath.com/t/topic/5460752 "2025-09-22T09:50:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gorby](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gorby/32/543563_2.png) [@gorby](https://forum.uipath.com/u/gorby)\
**Post date:** [September 22, 2025, 9:50am UTC](https://forum.uipath.com/t/topic/5460752/1 "2025-09-22T09:50:59Z")

</div>

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?

 ![Rethrow](https://global.discourse-cdn.com/uipath/original/4X/2/2/1/22188c66b28c78af37d5ac307dea57202a698374.png)

---

<div class="post-metadata">

**Author:** ![bhavesh.choubey](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/bhavesh.choubey/32/535427_2.png) [@bhavesh.choubey](https://forum.uipath.com/u/bhavesh.choubey)\
**Post date:** [September 22, 2025, 10:08am UTC](https://forum.uipath.com/t/topic/5460752/2 "2025-09-22T10:08:13Z")

</div>

namaste @gorby Q1 If the error means the whole workflow cannot continue or either handle it locally with termination or rethrow so the top-level Catch ends the workflow consistently.

For Q2 surround the `One Business Process` sequence with a TryCatch and in the Catch block, log the error and move on to the next DataRow and do not rethrow here otherwise the exception will bubble up to the top-level TryCatch and stop everything.

Cheers

---

<div class="post-metadata">

**Author:** ![sagar.singh1](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sagar.singh1/32/542993_2.png) [@sagar.singh1](https://forum.uipath.com/u/sagar.singh1)\
**Post date:** [September 22, 2025, 10:12am UTC](https://forum.uipath.com/t/topic/5460752/4 "2025-09-22T10:12:53Z")

</div>

Hello @gorby

1. INPUT File Check:- If the input file is missing, the process cannot continue, so catch the error, ‘log it’, then rethrow to the global Catch block to terminate the workflow cleanly.

2. One Business Process (Single DataRow):- Handle locally, do NOT Rethrow. If processing ‘one row’ fails, ‘log the error’ and continue with the next row so the workflow keeps running without stopping.

---

<div class="post-metadata">

**Author:** ![gorby](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gorby/32/543563_2.png) [@gorby](https://forum.uipath.com/u/gorby)\
**Post date:** [September 22, 2025, 10:18am UTC](https://forum.uipath.com/t/topic/5460752/5 "2025-09-22T10:18:33Z")

</div>

Hey, exemplary Ashoka mind@bhavesh.choubey,  
Your feedback affirmed my thinking and gave me reassurance.

While cleaning up my newly purchased e-VITARA.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [September 25, 2025, 10:19am UTC](https://forum.uipath.com/t/topic/5460752/6 "2025-09-25T10:19:25Z")

</div>

Closed on September 25, 2025, 10:19am UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
