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.

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

  1. Open Microsoft Excel locally and save a blank CSV file. The logging information will be stored in this file.

  2. Close the CSV file.

  3. Open Nintex RPA LE and complete the following steps: 

    1. In the far right column, click +.

    2. Click Log.

    3. Name the error log.

    4. Select the location of the CSV file that you created in step 1.

    5. In the top left corner of the pop-up window, click click +.

    6. On the left side of the window, click Botflow.

    7. Click Current Record Number.

    8. 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.

    9. Click OK.

Step 3: Create the Error Task

  1. In the far right column in Nintex RPA LE, click +.

  2. Click Task.

  3. Name the Task, "Error Task: Log and go to next record."

    Two Tasks will be visible.

  4. Double-click on the Error Task that you created.

  5. 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.

  6. 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

  1. 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.

  2. Locate the spot in your script after you have imported your data and before you begin to process your data.

  3. In the far left Actions column, click Flow and then select Set Error Task.

  4. Select the name of the Error Task that you created, toggle the Task to Don't Run, and click OK.

  5. Locate the spot in your script where all of the records are done processing.

  6. 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.