Try Catch functionality

I’m doing a download routine.
Within this routine I have a sequence that sometimes fails.
I would like to make a treatment of this routine for when giving error saving in a log file.
Trying to use TRY CATCH, I put the whole routine inside TRY, but I don’t know what to select in CATCH. Is there an option in catch that handles any exception?
I’m still testing by Studio, without having published a version.

@tainan.ramos
With the configuration of catching all system.exceptions within the try Block a General reaction on all exceptions IS done. Insider you implement the detailed exception Handling e.g with Log Message Activity writing some Info into the Log file

Exception will catch all exceptions, as long as you do not provide catches for more specific exceptions. I recommend that after you log the data to use the ReThrow activity to make sure the process still fails. It can be dangerous to allow the process to continue after a failure if you do not provide a workaround in the Catch block.

I also only recommend using the Try Catch block around the entire project if your project is small. Generally, using the REFramework template from UiPath is a more stable solution, but it does take time to learn how the framework handles exceptions.

3 Likes

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