Need help in Equations in Part

I have a part model where I insert an equation. This equation drives the size (e.g. diameter and length) by just changing two reference dimensions. When I change one of the reference dimension in a certain value, one feature (a revolve cut feature) becomes error. This is because there is no material cut with the revolve cut feature at this point. My question is: How can I input in my equation an argument (IF, THEN, ELSE) that will suppress this revolve cut feature when error and retain as is when not error. I cannot infer the range of the values of reference dimension that the revolve cut feature will become error. Please help.

SolidworksApi macros