Exception handling When any of the Activity fails to load

I have a workflow, the workflow is working as expected I just need to add an exception to workflow as when any activity fails to load it should log the name of the failed activity to a txt file with date and time

@Ishan_Shelke1

Note: To get the name of the activity at which the exception has raised, the workflow should be invoked

Follow the below steps

  • Place the invoked workflow in try catch
  • In the catch block use Append Line activity, and give the file path, text as

Now.ToString(MM-dd-yyyy HH_mm_ss tt) & " : " & : exception.souce

1 Like

Hi @Ishan_Shelke1,

Please use write text file activity in the catch block and write the exception.message+ " at source "+ exception.souce+ Date.now.tostring to it.

image

Hi @Ishan_Shelke1

surround your workflow with Try catch

Place your workflow code in Try Block

so if an exception happens that will be handled in catch accordingly

in the Catch section you would need to specify the following: exception.Source which will give you the name of the activity. You can also use exception.Message to get the specific error message.

so you can use write Text file where input would be
DateTime.Now.ToString(dd-MM-yyyy HH_mm_ss )+" "+Exception.source

@Ishan_Shelke1 Please find the below sample workflow

ExceptionHandling.zip (3.8 KB)

Hello @Ishan_Shelke1 ,

Have you check the global exception handler? Give a try it will address your need.

Regards
Balram

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