TryCatch - Get activity: "DisplayName"

Iv Tried Multiple ways to get the “DisplayName” attribute when a process fails. is this even possible with UI path?

I have tried a Trycatch, and attempted to get the by using “exception.Source.tostring” , but it never returns the DisplayName of the Activity that gave the error.

How can this be done without having to load the log files, which will show the Displayname. .

PLEASE HELP! :slight_smile: @badita
.

3 Likes

You are right.

It seems it is working only if you use Invoke (to another file). We’ll investigate.
See the attached workflows and run Main.

Click.xaml (5.1 KB)
Main.xaml (6.0 KB)

1 Like

Hey Badita, has there been any update on this yet? If I try your example I’m getting ‘UIPath.Executor’ in the message box, and not ‘Click H3’ (which is the display name of the click activity).

Strange, I’ve just run it and this is the result of running the example:

This is only when you run it from Main. If you then go to the Click.xaml and encapsulate that Click with a Try-Catch, it will return:
image

I have trouble reproducing it so that it returns UIPath.Executor, but I found that it was considered an expected behaviour a while ago.

The solution to get the exception.Source is to use Invoke Workflow in the Try Catch instead of the alone activity.