Get name error

Now I use code below.

faultedDetails = exception.Data("FaultedDetails")

note : faultedDetails is object type.

Then,

Activity name:

faultedDetails.GetType().GetProperty("ActivityFullName").GetValue(faultedDetails, Nothing).ToString

Display name:

faultedDetails.GetType().GetProperty("DisplayName").GetValue(faultedDetails, Nothing).ToString

But output show error as below.

image

remark : I want activity name and display name that error.

Please guide me for solve it.
Thank you

Hi @Stef_99

I would suggest you to try enclosing the sequence or module from where you want to check the error details (orgin-activity name, error description) within a try and catch. In the catch block by using,

Activity name where the error occured can be found by using, exception.source

The error description can be checked using,
exception.message / exception. Torstring.

Hope this helps.

Kindly Mark the answer as solution if it helps you.

Cheers

Happy automating.!!

Thanks,
Gautham.

Hi,

Unfortunately, different versions behave slight differently around exception handling, and resent version doesn’t return theses items in debug mode. So, perhaps you should check if it’s null or not, and also use Exception.Source etc.
(Probably, in actual run, it returns theses items)

Regards,

@Gautham_Pattabiraman @Yoichi I use exception.source , exception.message / exception. Torstring.
But show data as below.

image

Hi,

Did you use InvokeWorkflowFile activity as the following post? At least, it needs.

Regards,

@Yoichi It error as below.

image

image

Can you share the value of exception.Data("FaultedDetails")?

@noufalahammed null

image

I think this is the reason why you are not able to fetch activity name

Please check the below result of the same expression when there is any details

FaultedDetails { ActivityFullName=null, ActivityId=null, DisplayName="If --LoginRequired", WorkflowFile=null }

@noufalahammed how to check ?

FaultedDetails { ActivityFullName=null, ActivityId=null, DisplayName=“If --LoginRequired”, WorkflowFile=null }

Keep a breakpoint in your multiple assign activity in catch section. Then type exception.Data("FaultedDetails") expression in Immediate panel. It will give you the value if there is any info in Data property.

You can also try exception.Data("FaultedDetails").GetType().GetProperty("DisplayName").GetValue(exception.Data("FaultedDetails"),Nothing) expression in Immediate panel to check the result

@noufalahammed If I use breakpoint and run debug mode , it not go to catch block.

Can you clarify, where does the process throws error in Try block?

You can also do Step-Into in debugging to understand the execution flow of your workflow.

@noufalahammed process error in try block.
and I want get activity name that error and send mail in catch block.

Hey @Stef_99 ,

I looked into various methods for fetching the activity name which is causing the exception.

I couldn’t find anything as such , for the sake of finding the last activity before the exception we can open the orchestrator logs with log level set to trace which would help you to determine which activity caused the exception.

Happy automating.!

Thanks,
Gautham.

Does anyone have any methods to recommend?

Hey @Stef_99 ,

Found a method where we can leverage the functionality of a rethrow activity for getting the name of the activity in which the error is occurring.
image

Attaching a sample flow for your reference.
TestProcess.zip (4.0 KB)

Hope it Helps.

Happy Automating…!!

Hey @Stef_99 ,

I understand the scenario is like, inside ‘App_Login*’ module you have the Try Catch Block and In main.xaml, it is being invoked.

Step 1 : Have the rethrow inside the catch block of ‘App_Login*’ module.

Step 2 : In the ‘Main.xaml’, Enclose the ‘Invoke App_Login*’ flow with Try catch, Have the invoke in the Try block and In the catch you can use ‘exception.Source’ and ‘exception.message’ Just like in the earlier sample flow I had attached.

Attaching one more flow for your reference,
TestProcess.zip (4.4 KB)

Hope this helps you. Cheers…!!
Happy Automating…!!

Thanks,
Gautham.

@Gautham_Pattabiraman Now I can get activity name already.
But If I copy code to another com(same code), It don’t have data in exception.data
image

Please guide me for solve it.
Thank you.

Any idea for​ solve it?