Catch block not catching exception

Hi All,

Exception is getting caught when single statement is written inside try block but not for sequence of statements.
I am using CE 2019.10(faced same issue with 2018.3).
Attaching xlml file for more details.

Please help!!!

Getusers.xaml (13.8 KB) Main.xaml (19.6 KB)

Kindly run in debug mode so that we could come to know what error we are getting and why it’s not getting to catch

Cheers @Hrutuja_Deokar

@Hrutuja_Deokar

May i know what type of exception you mentioned in Catch block to catch the exception ?

System.Exception and SelectorNotFoundException

To reproduce the issue , i did run it in debug mode and navigated somewhere else to get Selector not found exception but it did not go to catch block instead it stopped execution.

Faced similar issue when i was trying to do practice scenarios from foundation training lesson 12. Even the Answer provided has same issue.

May I know at which activity this error occurs
Kindly ensure once that activity is inside a TRY BLOCK in a TRY CATCH activity
And also choose System.Exception in catch block of that TRY CATCH activity

Cheers @Hrutuja_Deokar

NameGeneratorError TryCatchIssue1

I am clicking on Generate button and then extracting Name , Address, Email.
But when page is giving 502 error , it is unable to fetch those attribute and hence throwing exception.

As shown it is enclosed inside try block and catch block has System.Exception

1 Like

yah if that error occurs it will go to CATCH block as exception is thrown
Kindly ensure that we are not running in debug mode because only in that mode the catch wont take the exception

Cheers @Hrutuja_Deokar

2 Likes

Published robot offline and then downloaded from robot tray and ran from there.
Flow continued execution this time even when i got 502 but then in catch block i have specified Log Message and Message box. Message box is not appearing and not able to find logged message in logs.

Thanks @Palaniyappan

Facing same issue as of scenario 1 and scenario 2 in Try-Catch not working.
As per the solution , need to remove exceptionHandlerWorkflow from Project.json. But mine does not have any such thing.

Thanks
@Palaniyappan

@Palaniyappan
when i enclosed Invoke Workflow inside Try catch , its not going to catch block.
So, i included Try catch inside invoked workflow and it worked .

is this expected behavior ?

no buddy
if the invoked workflow placed inside a TRY block, fails, it will go to catch block for sure
but i wonder why i didnt
are we running in debug mode or normal mode
Cheers @Hrutuja_Deokar

normal mode

@Hrutuja_Deokar

MasterFile.xaml (5.7 KB) ChildFile.xaml (5.8 KB)

Check by running the MasterFile.xaml and let us know if the exception is not captured for these xamls as well.

@sarathi125 this is working as expected.

1 Like

@sarathi125 why mine one is not working ?

@Hrutuja_Deokar,
If you need the same way then you have to use Exception.Source

1 Like

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