Try Catch not working

Hi, i surrounded my whole sequence with Try Catch and clearly it suppose to catch this error by giving me a message box but it did not work. i used System.Exception which should catch common errors.

bas

1 Like

What happens when you remove try/catch ?

Try Catch wont catch the exception from other application. It will catch only the exceptions from Activity you have used.

So the best approach for this scenario is to use Element Exist.

  • Element Exist, Indicate the exception window.
  • Use If condition with Element Exist Output.
1 Like

@alyka96

UiPath handles exceptions only if the exception is thrown by the activities.
If the exception thrown by third party applications, UIPath can’t handle those.

For third party applications, you have to handle explicitly activities like Element Exists, Image Exists (error) etc.,

Regards,
Karthik Byggari

2 Likes

i see i see. that explains it. thank you very much :slight_smile:

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