Error Handling
Add an Error Task to a botflow Automated steps that you can design for each bot that will run. to provide global error handling and tell a bot what to do when it encounters an error. Error handling can be wrapped around parts of the script as needed. Create an Error Task and then use the Set Error Task action to trap unexpected situations that arise in the target application.
If an error occurs in a botflow, the Error Task runs and can:
- Close the target application
- Re-open the target application
- Resume by starting over at the beginning of the script
Error Task Behavior
After you create an Error Task and then Set the Error Task, it will behave in the following ways:
- The Error Task automatically runs when an action error occurs for any reason.
- An Error Task can include nearly any available action An instruction within a botflow..
- After the Error Task runs, the botflow stops, unless the Error Task includes a
Resume
action.
- Read about the Resume action to learn all the ways that you can resume the script after the Error Task has been run.
- If no task is designated as the Error Task at the time an action encounters errors, the script stops, unless the action was designed to ignore and continue.
- Some actions may be ignored when located in the
Error Task.
- Read the Understanding Ignored Actions for more information.
Note: Only one Task can be designated as the Error Task at any given time. Use the Set Error Task action in the script to change the Error Task as the botflow runs so that errors can be handled differently during various sections of the botflow.
Error Task Example
Scenario
After data is imported and records are run, an issue arises where the bot is not able to continue to run and it needs some logic to tell it what to do. To add error handling to this situation, import your data in Nintex RPA LE, create a log, create an Error Task, implement the new Error Task, and then test it.
Step 1: Import Your Data into Nintex RPA LE
Step 2: Create a Log
-
Open Microsoft Excel locally and save a blank CSV file. The logging information will be stored in this file.
-
Close the CSV file.
-
Open Nintex RPA LE and complete the following steps:
-
In the far right column, click +.
-
Click Log.
-
Name the error log.
-
Select the location of the CSV file that you created in step 1.
-
In the top left corner of the pop-up window, click click +.
-
On the left side of the window, click Botflow.
-
Click Current Record Number.
-
Click the item to process to select the variable that you want to log or click the name of the record that identifies which record value to log. A few rows will be generated and the preview field will display some values.
-
Click OK.
-
Step 3: Create the Error Task
-
In the far right column in Nintex RPA LE, click +.
-
Click Task.
-
Name the Task, "Error Task: Log and go to next record."
Two Tasks will be visible.
-
Double-click on the Error Task that you created.
-
In the far left Actions column, click Data, select Write Log, change the message type to Error, toggle the Task to Don't Run, and click OK.
-
In the far left Actions column, click Flow, select Resume, select Skip the Action, toggle the Task to Don't Run, and click OK.
Step 4: Implement the Error Task
-
In the far right column in Nintex RPA LE, click Tasks and then double-click on the name of the Error Task that you created.
Your Error Task and its associated steps are visible in the left column.
-
Locate the spot in your script after you have imported your data and before you begin to process your data.
-
In the far left Actions column, click Flow and then select Set Error Task.
-
Select the name of the Error Task that you created, toggle the Task to Don't Run, and click OK.
-
Locate the spot in your script where all of the records are done processing.
-
In the far left Actions column, click Flow, select Clear Error Task, toggle the Task to Don't Run, and click OK.
Step 5: Test the Script
Run the script from the top. Each record that is missed will be added to the CSV file that you created.