Can anyone explain how to generate customized logs in uipath for the activities that throw error. Like is it possible to create csv log file or any other format for particularly those activities that throw exception? If so is it possible to include the activity names that failed in the customized log file? Also how to correct unhandled exception that occurs randomly? Is there any way to include all types of exception in a single exception?
I want to prepend this by saying that this is much easier if you’re using the REFramework, so my explanation will be based on that.
You can create a log file for errors. A datatable can be created where a row can be added for each exception. Define the table with whatever fields you want to include. The exception is stored in the
exceptionvariable in the Catch block for the exception given.
To get the activity name, you can use
Correcting unhandled exceptions that occur randomly depends on the exception. There is no method for correcting all unknown exceptions. You’ll have to define the logic yourself.
If you’re using the REFramework, BusinessRuleExceptions are separated from all other exceptions, but outside of that, all exceptions can be caught if your Catch block is looking for System.Exception with no further specificity.
Thank you for your reply. As you said, all exceptions can be caught if your catch block is looking for System.Exception, I am not able to catch FormatException just by adding System.Exception in the catch block coz it still pops up the error message. I have to add System.FormatException in the catch block to fix this. Am I missing anything here?
If you’re running the code in Debug mode, you will still see errors. If you continue through them, you’ll reach the Catch block.
Okay thank you Anthony