How to get the workflow name in catch block for unknown execption

So basically, I’ve set-up a try catch block for my main workflow with a series of invoke workflows. I am trying to display/get the name of the invoke workflow that gave an error, in the catch block in my main.xaml. I tried doing the exception.source but it gives me the actual activity that gave an error, not the workflow name. Thank you.

Hi,

Can you try the following in the catch state?

faultedDetails = exception.Data("FaultedDetails")
workflowName = faultedDetails.GetType().GetProperty("WorkflowFile").GetValue(faultedDetails, Nothing).ToString

Note: faultedDetails is object type

Regards,

2 Likes

Hi @Archie

You can use my new developed Alphabet.Workflow.Activities

UiPath Gallery Link

It contains “Get Xaml File Name” activity

Thank you.

Sorry for the late reply. I tried this on the catch block. It prints the full file location of the xaml so I just did the Path.GetFileName. Thank you very much!

1 Like

Thanks for the reply too, it works fine too.

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