Try Catch didn't catch the exception

Hi all, I am doing the UiPath tutorial practice with Try Catch activity.
I am looping through an excel file, and try to do a simple calculation. In my try block, I have an assign activity to assign the excel cell value to an Int32 variable.

Some data contains letters, so this assign activity may fail. However, the catch never worked no matter how I set the “catch” and the process always stopped. I’ve tried “System.Exception”, RemoteException, System.InvalidOperationException, but none worked.

Any ideas?

Hi @Ellie.Smith

Check the below thread

Check if if you click on Run the exception is getting catched.

Regards

Hi,

Can you try to turn on ContinueOnException then debug run?

Or try to just run (not debug)

regards,

Thanks @vrdabberu .

I checked the thread, but mine didn’t use global exception handler. I created the project in Studio.

this is the project.json details:

{
“name”: “BlankProcess1”,
“projectId”: “e534dfda-68ff-476b-b3ff-efaf77070422”,
“description”: “Blank Process”,
“main”: “Main.xaml”,
“dependencies”: {
“UiPath.Excel.Activities”: “[2.23.2-preview]”,
“UiPath.Mail.Activities”: “[1.22.1]”,
“UiPath.System.Activities”: “[24.2.0-preview]”,
“UiPath.Testing.Activities”: “[24.2.0-preview]”,
“UiPath.UIAutomation.Activities”: “[24.2.0-preview]”
},
“webServices”: ,
“entitiesStores”: ,
“schemaVersion”: “4.0”,
“studioVersion”: “24.2.0.0”,
“projectVersion”: “1.0.0”,
“runtimeOptions”: {
“autoDispose”: false,
“netFrameworkLazyLoading”: false,
“isPausable”: true,
“isAttended”: false,
“requiresUserInteraction”: true,
“supportsPersistence”: false,
“workflowSerialization”: “DataContract”,
“excludedLoggedData”: [
“Private:*”,
password
],
“executionType”: “Workflow”,
“readyForPiP”: false,
“startsInPiP”: false,
“mustRestoreAllDependencies”: true,
“pipType”: “ChildSession”
},
“designOptions”: {
“projectProfile”: “Developement”,
“outputType”: “Process”,
“libraryOptions”: {
“includeOriginalXaml”: false,
“privateWorkflows”:
},
“processOptions”: {
“ignoredFiles”:
},
“fileInfoCollection”: ,
“saveToCloud”: false
},
“expressionLanguage”: “VisualBasic”,
“entryPoints”: [
{
“filePath”: “Main.xaml”,
“uniqueId”: “6f0d9db7-d9cc-465c-934f-53477991ebeb”,
“input”: ,
“output”:
}
],
“isTemplate”: false,
“templateProjectData”: {},
“publishData”: {},
“targetFramework”: “Windows”

Hi @Ellie.Smith

Try clicking Run File or Run and check if exception is getting catched. Do not Debug the process.

Regards

1 Like

Hi @Yoichi ,

with that, the process acted the same way - the exception was still not caught or properly handled.

Hi,

Can you share screenshot of Catch section? Did you set System.Exception?

Regards,

sure - currently set to System.Exception

Hi,

It seems TryCatch works because Warning Log is displayed

image

And next Assign in the catch seems to throw exception. As a result, workflow is terminated.

Regards,

1 Like

Thanks @vrdabberu and @Yoichi - the exceptions are caught when i do it in “run” mode. :slight_smile:

Hope your query is resolved @Ellie.Smith . If yes, please mark the post from where you found the solution to close the loop or if you haver any queries, I’m happy to help.

Regards

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