Try catch log message for exception

Hi Guys. Is there any way of including the uipath exception into the log message activity inside the catch statement log message.

Yah of course
With this expression we can
β€œThe process got faulted unfortunately at : β€œ + Exception.Source.ToString + β€œ due to : β€œ + Exception.Message.ToString

Put this inside the log message activity inside the. Catch block
Cheers @bobby

Thanks man. Is there any easy way to write it to a notepad file?

yah ofcourse we can assign this to a string variable and pass that as input to write text file activity
https://docs.uipath.com/activities/docs/write-text-file

Cheers @bobby

Thank you for your help