I want to make sure that my template switch is only called with nodes it can handle. If it is used with an unrecognized concept, I would like code generation to fail with an error. Is there a way to throw generation-time errors from templates?
Note: The workaround I have been using is to generate invalid output that will cause an error down the line, for example:
default: <T "unknown command: " + $COPY_SRC$[null] T>
which will then generate an error like
textgen error: 'No textgen for Draw.structure.Fill' in [rightExpression] Fill null[847086916112855242] in Draw.sandbox@0
when Fill
is a concept not recognized by the switch.