Catch Block Query

Hi, As per the last post we discussed. I want to excel rows reduction value. I got it perfect.
Now my question is I invoked this workflow in the Try Block and use write activity to check the counter value and I got 0 print value as it is my last value. Here it’s fine.
Next in the Catch Block I assigned counter = 0 to stop my process and go to the end process state.
But it’s working fine. I just want to know then why it’s not going into the Catch Block If I gave the condition counter = 0 in the Catch as I am get the last 0 value of counter from the Try Block.
@Palaniyappan @Lahiru.Fernando
This is Try Block where I got the 0 value
image
But I want to know why it’s not going inot the Catch Block as I defined the condition counter = 0 in the Catch block.
image

It’s working fine as I want, I want when the counter value 0 it end of the process. But in the Try Block it’s get 0 value. And in the Catch Block it’s checking the value 0. Then it decide but why it’s not executuing the write query in the Catch Block.

Hi
usually the catch block will get executed only when any exception occurs in the TRY block
so thats why we are not able to get into catch with 0
Cheers @balkishan

1 Like

No, As I got the value 0 in the Try Block. And I give the assigned the same variable value 0 in the Catch Block. So that’s way I want to know.

1 Like

ok, no problem
but thats the reason
Cheers @balkishan

1 Like

this implies the same, only when any process fails in try block it will go to catch block and take the counter as 0 and goes to end process
Cheers @balkishan

Hi @balkishan

As @Palaniyappan explained, catch will only execute in case you get into any error in the try section. If the try section completes without any issue your catch will be ignored.

Are you trying to check kind of a condition here? To run something when the counter is equal to zero or something? It looks to me like that.

If so, you might need to use a IF activity for that instead of the try catch

2 Likes

@Lahiru.Fernando @Palaniyappan understood, I thought I assigned 0 in the Catch Block and same I get the 0 value in the Try Block. So thought once get 0 it will check in the Catch Block and decide to continue or stop the process. Anyway bro’s understood.
For testing I give the corrupted excel file then only my Catch Block Executed.

2 Likes

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