This article covers some advanced error handling techniques that involve filtering and nesting.
There are 2 kinds of filtering that can take place on an error handler route:
1) Adding a filter to the error handler route
You can use a filter to control which errors are handled by the error handler route. This allows you to process only specific types of errors. If an error does not pass through the filter, it will be treated as if there is no error handler route defined for the given module.
2) Adding a Router followed by filters to the error handler route
As you can see above, the error takes place at the Create a folder module (A) which has a regular route and an error handler route. The latter is followed by a router with 1 route with a filter that defines a specific type of error (Data Error Takes Place), and the other which is the default route for all other errors. The first route ends with the Resume directive which contains substitute values for the scenario to resume from module A (Create a folder), while the second route ends with the Rollback directive which stops the scenario execution immediately.
See the Error processing section for further information on various error types and on how Integromat processes and evaluates them.
Use an existing Dropbox folder to upload a file instead of creating a new one
If you use the Create a folder module on Dropbox and a folder with the same name already exists, the module will throw a Data Error as shown below:
Here's the complete scenario:
Below is a detailed explanation from the 5th statement onwards:
5. In order to use the existing folder in your subsequent modules (Upload a file below), you need to add an error handler route to the module and fetch the ID and name of the folder followed by the Resume directive.
5.1 The filter at the beginning of the error handling route is set to handle only the particular error which appears when a folder with the same name already exists:
5.2 The Dropbox > List all files in a folder module is configured to return all the folders in the target folder. The filter after it passes only the one we were originally trying to create (its name is stored in the
4. New Folder Name item):
5.3 Eventually, the Resume directive supplies the output for the failed module:
Regardless of where a module is located, error handler routes can be created and implemented on all modules, except routers. Thus, it is possible to create an error handler route for a module that is already part of an existing error handler route created for another module.