Try Catch Printing Exception Source



I have an activity to click image if it cannot find the image it throws an exception and source field in the exception pop up tells me exactly which image(My Display name) is throwing the exception.But when I catch that exception, exception.source property gives me system.activities as an Output.

How to get the exact source Any Ideas??

How to display Process Name and Main Xaml and Error activity name and error flow name
Try/Catch - exact source of exception is not shown

Try exception.Tostring or exception.Message.

Need inforrmation about Timeout error

Both Try exception.Tostring or exception.Message says Image not found.It doesn’t say explicitly which Image

Exception Handling example

True. It seems to be a bug.I think you can capture the Displayname in a variable or hardcode in that specific exception.

@badita can you help

Uninformative error message

yes, check this here. (7.6 KB)

Only that it works only if the error occurs in an invoked workflow.


  • do your actions in wf1
  • in main add try {invoke wf1;} catch(exception ex) {log ex.source};
  • run main

and it will work.

How to get Exception source "Activity Description name"
How to get a display name of activity that gave error using try catch
Exception Handling example
Killing a process if a job failed
Exception Location
Exception Location
Catch every error inside a workflow
Try/Catch - exact source of exception is not shown

Thanks @badita. It worked.

Obtain Sequence's DisplayName

So what you are saying is, if we want to have the name of the activity, we need to have all error handling in another workflow, like:

workflow: RUNME
invoke main }
catch all exceptions{
Print activity name}

Is there really not smarter solution?
If not, could there be an option when starting a new project to automatically generate a file with above content?


Hi badita,

I appreciate your sharing knowledge for logging exception.source.

Couldn’t we log exception source when we use only 1 workflow which don’t have [Invoke workflow] ?



As of now…no. We are limited by the WF technology.




Hi @badita,
This solution provides us the activity name in which the exception occured.
But if I have multiple files how can I know in which file this exception occured?

Is there any solution for us to know both the below things.

  • I want to know activity name in which the exception occured
  • Also I want to know the file name in which the exception occured.

Could you help on this?



It might be helpful to store like a destination variable before each Invoke, so you know where it is in the process. Then you can use that to know which part of the process failed and attach that with the Source and Message. However, depending on your framework, if your Try/Catch is outside of your entire process, then that destination variable will not get stored through the Arguments since Arguments are not passed in the event of an Exception, unless you maybe store your destination in a file.