I have a scenario that pulls a record from a datastore. I want processing to continue if the record is retrieved, but if the key does not exist, i want alternate processing and then stop.
I tried the “get a record” and then attach error handling to “ignore” which the documentation says should stop processing that bundle but continue with other bundles. So far it isn’t doing this. All bundles process as expected without entering the error handler at all, even when the key does not exist.
Do I need to do anything special to throw an error from “get a record” from a datastore?
How can I make the error take a short alternate path (some cleanup actions) and then go back to the next bundle for regular processing?
It won’t throw an error, it just won’t return any result. So the best thing to do is use a router and have a filter for if the output has a key or not.
Ok, So how do we know if a module will throw an error or not? is it documented?
Ok, so i could add a router and set a filter to “exists” or not null, and do the regular processing, then have a fallback route that has a few steps for cleanup and stops. In that scenario, would a missed record only take the fallback route will all other bundles only take the exists route?
It’s just how this particular module works. Data stores only give errors if there’s a server issue or you try to do something that isn’t allowed, like omitting required fields or invalid type of data. The Get a Record module works the same as Search Records, no result is not an error.
Different apps may behave differently, depending on their particular integration and API response. It’s actually quite annoying when APIs return errors for no results, Slack’s Search Users module does that. Rather then simply having a filter for if a result is found or not, you have to add an error handler and resume module.
And yes what you said about the fallback route is true, though I personally prefer to specify my route filters rather than rely on the fallback setting, but I don’t think it really matters.
Hope this helps! Let me know if there are any further questions or issues.
Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —