Try Catch Exceptions

How would I be able to extract the activity the Try failed at within the Catch?


Let me say you have two xamls called file1.xaml and file2.xaml

If you are invoking file2.xaml from file1.xaml using invoke workflow activity and you have TryCatch block in file1.xaml alone.

Then in the catch part you can get the file2.xaml activity name using exception.source.
file2.xaml should not have try catch in this scenario.

with this expression inside the catch block
within log message activity
Exception.Source.ToString this will give the name of the activity where it failed
Exception.Message.ToString this will give the exception message

Cheers @cvs0115

Hi @sarathi125!

So we are creating reusable assets via libraries. The libraries would house actions within a screen or an application. We are using the RPA standards: Pre-Action, Action, Post-Actions. With this method we can throw errors if conditions arn’t met such as element does not exists. We house these within a sequence and the sequence is housed within a Try Catch. The Catch includes Two types on exceptions systems and unknown.

My issue is how do I extract the activity the unknown failure occured? Exception.Source is not giving me what I need.



Check the xamls and run the master.xaml, it will help you to understand.
ChildFile.xaml (5.8 KB) MasterFile.xaml (5.1 KB)

The only way I can grab the Activity Name that failed is to use an invoke inside a Try?

Is that standard practice for UiPath is to only catch Unknown Exceptions at a higher level of automation?

Check all these links,

Thanks @sarathi125!

A few of the forums mention a bug. Can anyone tell me if UiPath is working on the bug?

If you are on EE (Enterprise Edition) please also contact with the UiPath Technical Support:

Contact Technical Support

Contact UiPath Technical Support department.

1 Like

@sarathi125 We are working with vendors to secure licenses. We will work with Tech Support to identify if this is a bug or a design standard. Thank you!

1 Like