Rollback error handler
The Rollback error handler stops the scenario run and reverts changes made by modules that support transactions. They always use a database app, like MySQL or Data store. Make cannot undo actions made by modules that don't support transactions, like Gmail > Send an email or Dropbox > Delete a file.
The bundle that caused the error doesn't continue in the scenario flow. In addition, Make doesn't process any remaining bundles.
Make marks the scenario run as an error in the scenario history. Make won't disable the scenario because of consecutive errors.
If we added the Rollback error handler to the Update a record module, the Rollback error handler would stop processing the bundle in the scenario. Make wouldn't process the remaining bundles.
Let's check the data in the data store as well.
If you disable the Auto-commit option in the scenario settings, Make reverts the changes that happened when Make was processing the bundle in modules that support transactions.
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
.The second bundle gets to the first Update a record module successfully, but causes an error in the second module. The Rollback error handler reverts the update from the second bundle and stops the scenario.
The first row now contains the update from the first module only:
ID = 4, Name = Test 4
.The second row contains the original data:
ID = 2, Name = Test 2
.Make doesn't update the third row because the Rollback error handler stopped the scenario run already. The data in the third row remain the same:
ID = 3, Name = Test 3
.
If you keep the Auto-commit option enabled, Make reverts the changes made by the module that output the error if the module supports transactions.
The first bundle of data gets through the scenario flow successfully and updates the first row of data in the data store both times. Make commits all changes and they cannot be rolled back later.
The first row contains the update from the second Update a record module:
ID = 5, Name = Test 5
.The second bundle gets to the first Update a record module successfully. Make commits all changes and they cannot be rolled back later. The second bundle causes an error in the second module.
The Rollback error handler 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
.Make doesn't update the third row because the Rollback error handler stopped the scenario run already. The data in the third row remain the same:
ID = 3, Name = Test 3
.
You can use the Rollback error handler to stop the scenario run and undo changes when the module outputs an error.
For more information about error handling strategies check the overview of error handling.
Undo changes to your data when an error happens
With the Rollback error handler, you can stop the scenario and undo changes when the module outputs an error. You can only undo changes in modules that support transactions.
For example, the following scenario outputs an error in the Data Store app module:
To stop the scenario and undo changes where possible when an error happens, follow the steps:
Right-click the module that is causing the error. In the menu, select Add error handler.
Select the Rollback error handler.
Optional: Go to scenario settings and disable the Auto-commit option.
When an error happens, the module that outputs the error reverts changes if the module supports transactions. If you disable the Auto-commit option, all modules in the scenario that support transactions undo changes.
Save your scenario.
You added the Rollback error handler to your scenario. When an error occurs in the Data store module, the scenario stops and Make reverts changes made by the erroring bundle in modules that support transactions.