UiPath Try Catch - Full Tutorial From Start to Finish

Published: 19 March 2021
on channel: Anders Jensen
19,618
524

This UiPath video tutorial shows how to use the Try Catch activity in UiPath. We use the Try Catch to handle exceptions and to do extensive logging. The Try Catch is especially helpful when we create transaction-based workflows (like the UiPath REFramework), and we want the robot to continue when we encounter errors/exceptions.

📁 Download the course materials: https://andersjensen.org/try-catch-an...

You could also watch:
🎥 UiPath REFramework (1-hour Full Tutorial with extensive exception handling):    • UiPath REFramework - Full Tutorial - ...  
🎥 UiPath Try Catch - an easy guide:    • UiPath: Try Catch - an easy guide  

👪 My Facebook Group where we solve UiPath problems and chat around automation in general:   / 1817369781750298  

0:00 What is a Try Catch activity in UiPath
The Try Catch helps us to handle errors and exceptions. It's advantageous when we create transaction-based workflows, just like we do in the UiPath REFramework. Another benefit is that logging is made very easy. Make sure to be active yourself to learn the most. Download the course materials: https://andersjensen.org/lessons/try-... AND have UiPath open and copy what I do. There is no magic to the Try Catch. In the Try, we put in our chosen activity (/activities). If an exception occurs, we can define, what will happen using the Catch. Typically we write a log message.

1:28 Try Catch Use Case
We go through a simple exception handling Try Catch example, where we work with transactions and apply some forced exceptions to go through the different exception types and how we handle them. Read the Excel sheet from the course materials and use a For Each Row to iterate through each transaction. For each transaction, we'll take the data (here just a number) and apply it to the system application (here the Windows calculator).

8:47 Forcing an Exception
We force an application exception (selector not found) in order to see, how easily we can handle this with the Try Catch.

10:18 Try Catch
Try: We try an activity and if there is an exception, we define what we want to do in the Catch
Catch: In the Catch we define what we want to when the exception occurs. We can separate each exception type.
Finally: Activities that will happen, when either the activity runs without exception(s) or an activity has thrown an exception and that has been caught in the Catch.

15:00 BusinessRuleException
The Business Rule Exception is used, when we have errors with the data (incomplete like missing a surname, completely missing, outside of boundaries, or general data validation). In this example, we force a BusinessRuleException by making invalid data in one of our transactions.

18:24 Throw activity
We can manually throw exceptions as well. Usually, it's done when we validate data and will throw a BusinessRuleException, when something is wrong.

Connect with me:
👥 Facebook -   / andersjensenorg  
🎮 Discord -   / discord  
💼 LinkedIn -   / andersjensens  
💌 Email Newsletter - https://andersjensen.org/email-newsle...
📷 Instagram -   / andersjensenorg  

#uipath #rpa #uipathcommunity


Watch video UiPath Try Catch - Full Tutorial From Start to Finish online without registration, duration hours minute second in high quality. This video was added by user Anders Jensen 19 March 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 19,61 once and liked it 52 people.