So as a Rule - WhatEver you Feel can break during an automation we keep it inside try Catch.
Example : Reading an value from an Excel file.
- Exception can be - Excel File is Not available
- Value is Not available.
So as a Developer - It depends on how you want to treat the above exceptions .
- Excel File Not availalble - Either you stop the Bot or you raise a notification and continue to next part.
Now if we want to send notification and continue - we will keep the Read Excel in Try Block - this means we are telling uipath that this block of code inside may have some Exception.
Now Uipath will ask you - Okay so if I encounter exception - How should i handle it - Then you will go to catch block and specify how to handle it - Select the appropriate exception type in catch – if not sure of type … select system.exception - this will handle all exception.
Then inside the catch- Write Log - Send Email etc … This is send email/ write log and process will continue … to next steps …
Now if you still want to stop automation - you drag Throw activity inside catch - this will again throw the exception and process Breaks
okay - Second Scenario - You are looking for a value inside excel sheet
- You did not get the value and you want to intimate someone and continue the proess… same way … put the read cell in try catch and inside catch - SendEmail - Here we have to continue the process … so we will not drag throw …
Hope it make sense