Articles → UIPATH → Throw Activity In Uipath
Throw Activity In Uipath
Purpose
Implementation
- Drag and drop the "try catch" activity in UiPath.
- In the try block
- Get the file name in the "FileName" variable.
- Check if the file name starts with the word "gyan" using the "if" activity.
- If the file name starts with the word "gyan" then read the text file using the "Read Text File" activity.
- Else throw an exception using the "throw" activity.
Click to Enlarge
- In the catch block
- Select the exception type as "System.Exception".
- Show the exception using the message box.
Click to Enlarge
- Save and run the bot.
Output
Click to Enlarge