Skip to main content

Commit error handler

The Commit error handler stops the scenario run and commits changes in your database apps. If your scenario is not using apps that support transactions, like MySQL or Data store, the Commit error handler just stops the scenario.

The bundle that caused the error doesn't go through the rest of the scenario flow. Make doesn't process the rest of the bundles.

If we added the Commit error handler to the Update a record module, the Commit error handler would stop processing the bundle in the scenario and save changes to your data in database apps. Make wouldn't process the remaining bundles.

commit-example-2.png

Let's check the data in the data store as well.

After running the scenario, Make would update the data in the data store:

commit-eh-data.png
  1. The first bundle of data gets through the scenario flow successfully and updates the first row of data in the data store both times. The first row contains the update from the second Update a record module: ID = 5, Name = Test 5.

  2. The second bundle gets to the first Update a record module successfully, but causes an error in the second module.

    The Commit error handler saves the update in the first module, but prevents the update in the second module and stops the scenario. The second row contains the update from the first module only: ID = 4, Name = Test 4.

  3. Make doesn't update the third row because the Commit error handler stopped the scenario run already. The data in the third row remain the same: ID = 3, Name = Test 3.

For more information about error handling strategies check the overview of error handling.

Stop the scenario when an error happens

With the Commit error handler, you can stop the scenario when an error happens. Make saves changes in the database apps in your scenario and doesn't process the rest of the bundles in the scenario flow.

For example, the following scenario outputs an error in the Data Store app module:

commit-example-3a.png
commit-example-3b.png

To stop the scenario and save changes, follow the steps:

  1. Right-click the module that is causing the error. In the menu, select Add error handler.

  2. Select the Commit error handler.

  3. Save your scenario.

You added the Commit error handler to your scenario. When an error occurs in the Data store module, the scenario stops and Make saves changes in modules that support transactions.

rollback-example-4.png