Documentation
The THROWIF command is a very simple tool which throws an exception if the contained statement is true.
gor ... | THROWIF <condition>