My pipe has a filter snap. I want to design it in a way that it throws a custom error when the filter snap does not let through any records.
I think you can only throw a custom error when the filter snap fails. Otherwise I would recommend using a mapper snap after the filter snap to check if the input is empty or not and fill it with default when empty and then use a router snap to route default to second output and create a custom error message.
Example pipeline below.
custom_error_filter_2023_04_04.slp (6.3 KB)
Let me know if this helps
Ok, so since it is a ‘double not’ condition, we need an AND operator (&&) to not pass the record if its null or empty. But there is another issue. When there is no data flowing to the output of the filter snap, the following snap (in this case the Mapper) doesn’t have any records to process. I want to throw an error message when this happens.
And if you enable null-safe acces in the filter snap?
After filter snap, you can have a script snap. In the script, if the input doc count is zero then u can throw a custom error.