Try/Catch - exact source of exception is not shown

studio

#1

I have written 2 workflows (say Parent & Child), Parent is invoked from Main & Child is called from Parent. In main there is no try/catch, but both parent & child has try/catch block.

The problem is exception.Source doesn’t give exact source, instead it gives “UiPath.Core.Activities”.
How to get the exact source ie name of activity ?


#2

You can use Rethrow option in this case. Also log messages in your workflows they will guide where the exception occured


#3

I have tried this, not working.


#4

Can you attach workflow or show what you are trying to achieve, because logging messages in catch block should work in any case. You have logged exception message in catch block right?


#5

You have logged exception message in catch block right? - Yes


#6

log_message.zip (8.2 KB)

File has been uploaded


#7

Try to add Try/Catch in Main.xaml and use expection.Source dont use try catch in Child Parent workflows this would give you the Source Exception

See this -


#8

Have a look at the RE Framework UIPath developed. It is better to have a try catch in the main workflow as it is easier to trace back the error from logs.


#9

Hi,

To properly and clearly track the source and have the activity names displayed, you need to have them surrounded by a Try Catch around an invoke workflow.

See this old post bellow explaining the concept

Cheers


#10

There is a problem in this, assume I have multiple transactions (for the same screen) maintained in an excel sheet, the sheet is opened in Parent & for every row of an excel sheet, the child workflow is invoked which is responsible to process the transaction. If any one of the transaction fails, the Parent workflow should not be terminated & should proceed to next one. More important I don’t have Orch. So the try/catch is written in the parent. What is the solution for this scenario ?