Exception handling

Let's handle any exceptions for this Excel automation:

  1. For this, click on Add a new Catch in the Catches block beneath the Try block.
  2. Choose exception as System.Exception and click the box next to it.
  1. Also, add a Log Message activity to the catch block and add the following:
    • Error as the Log Level
    • "Error in Excel read operation with following exception: "+exception.Message" as the Message: 

  1. Finally, within the Catches block, add a Terminate Workflow activity to stop the automation if there are any exceptions:

Great! This completes the ReadExcelRequest workflow where we read the Excel and stored the request data as arguments. Now, we will invoke this from the main workflow.