Forum Discussion
5 Replies
- JensDeveloperContributor II
Hi @vgautam64
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- vgautam64New Contributor III
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.
- vgautam64New Contributor III
This is how the validation looks like when there are no records going through.
- JensDeveloperContributor II
And if you enable null-safe acces in the filter snap?
- smudassirEmployee
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.