Try/catch does not catch when Try fails

Hi Community

When there is no more data in my datatable I get the error shown below.

Now this should not be an issues as long as I can use Try/catch and assign, a boolean called NoMoreData to true, in the catch. However the catch is not triggered when Try fails, as shown in the image.

Any suggestion is appreciated =D

2 Likes

Hi @ChrisPals

Try to add new exception or make it specific to the error. Kindly follow this link for your reference. Try Catch

cheers :smiley:

Happy learning :smiley:

2 Likes

Hi @ChrisPals

Try make the Catch a “System.Exception”.

Yours faithfully

Hi @pattyricarte and @LarsFeilberg

Thank you for the anwers

Tried both System.Exception and System.IndexOutOfRangeException

Niether worked. hmm

Yours Sincerely

1 Like

put a throw activity in your Try block at the very top and see if it is going to the catch block as expected

1 Like

I disabled the break on exceptions option in debug and it worked.

Thank you

1 Like