TryCatch - Get activity: "DisplayName"

#1

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
.

2 Likes

Get Display Name of Activity within Try Catch mechanism
例外処理で異常が発生したアクテイビティの名称を表示させる方法
#2

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)

0 Likes

#3

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).

0 Likes

#4

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.

0 Likes