Cancel gh based on part of result/errors?

I was surprised that one just needs to literally expire a DataDam to pass data through it. So for a pre-Rhino 9 solution, a script like this one should do the trick: