TryCatch

Estimated reading: 2 minutes 1513 views

The Try-Catch activity is an error handler, where you can handle the possible exceptions in a workflow with a different set of activities accommodating the Catch and block activity, ensuring that the process is not interrupted. The Try Catch activity has three segments within it, Try, Catch and Finally.

Try: is the segment of the activity that holds the executional sequence. This comprises a series of tasks which are likely to throw up errors.

Catch: is the segment of the activity that is used to handle the exception. This segment requires the exception type that the bot is required to handle. We also need to provide a sequence of activities that the bot must perform in the catch segment.

Finally, has a set of activities to be performed after the Try and Catches blocks are executed. This section is executed only when no exceptions are thrown or when an error. occurs and is caught in the Catches section.

The following activity explains how we are going to use the try catch activity in a simple workflow.
1. Drag and drop a try catch activity from the error handling feature.
2.Double click on the activity and drop a sequence activity from the control flow feature.
3. Design the above workflow inside the sequence activity by dragging and dropping the required activities. 
4. The next segment in the try catch activity is the catches. Here we need to choose the exception that the bot must handle. In this case we are going to choose System.exception. We can choose this exception by seeing the exception message that we get in our output window when the workflow is not executed.

Share this Doc

TryCatch

Or copy link

CONTENTS