System Error - not working as expected for Cint conversion

I was training some of my colleagues on UiPath Foundation course and worked on the Debugging chapter. While working on the excel String → Int conversion using Cint, the expectation is for the conversion to throw an exception which will be caught using the System.Exception. However it throws the error and stops at the Assign step. Not sure why this is and I got an error relating to InvalidCast exception.
Can someone help here? I have shared the screenshots here.

Hi @SantoshDS,
it seems like your first row contains alpha numeric values and that is why it is throwing an error.
if you are reading any excel then make sure to select Add Headers property.

Hope this will work for you.

Change your cashin variable from genericvalue to Int32 and try again.

Originally these variables were in Int32. Then I changed them to GenericValue. Anyways after you mentioned I tried them again. The same issue persists. I am not sure what is going wrong but for rest of the participants in the training the same error appears.

Hi Deepak,
This is one of the practices from the Debugging and Exceptions lesson in UiPath foundation training. The addition of 2 numbers in an excel is to be done in the bot, if one of the columns contains alphanumeric, then it’ll error because of not able to convert to Integer. Then we need the Error to be captured in the Try Catch block. Although there is a Catch block with Exception, the control is not moving to Catch block. That’s the issue.

Hi @SantoshDS,
have you used Global handler in your process?
if yes, open your project.json and check for “exceptionHandlerWorkflow”: “GlobalHandler.xaml”
else check your workflow if you missed anything or please share the workflow if possible.


Hi Deepak,
Here you go. There was no parameter in the json file with Global handler.
Lesson 12 - practice 1 - exceptionsSheet.xlsx (8.4 KB) Sequence1.xaml (14.4 KB)

Did you tried clicking on continue button. In case of exception, it will stop in try block itself, it’s expected in debug mode but you need to click on continue (just few times, not every time, till you come out the block where error occurred) then your flow will continue.

Hi Aman,
Yes, I tried it. In this case, every time there is an error it stops in that step. And I keep clicking on Continue and it never goes to the Catch Block. Ideally when it errors, it should go to catch block and run the activites under that. However the control never goes to Catch block even if I click on Continue.

It definitely goes to catch block. Put a breakpoint in catch block and check

Don’t forget to mark it answered if it works for you as it motivates/helps others to read till end. (21.0 KB)

Hi @SantoshDS,
could you please try attached xaml file along with its project.json?
please delete your old project.json file.


Hi Aman,
You are right. It is definitely going to the Catch block. I didnt notice it until I put the breakpoint.
Thanks for sharing it.
Santosh Sundar

Good to hear. :slight_smile:

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