Creating error-proof reusable workflows in UiPath

Hi @Steven_McKeering,

I appreciate your very thoughtful inputs :slight_smile:

A check on a string is empty or null can be another alternative to Try and Catch. I try limiting the use of try catch on activity level and rather use it on a workflow level / wrapper level (invoked workflow/s within a wrapper) and let the Process.xaml decide how the error needs to be thrown to Process Transaction state.
I have found that this approach ensures easy debugging provided all the three arguments (out_Success, out_ErrorMessage, and out_FileName) can be accessible by the Process.xaml.

Yes one disadvantage will be that an additional log message (error type) is written by the Throw activity in Process.xaml. This is in addition to the error message being written by the catch block of the invoked workflow.

2 Likes