handle expected error consistently as with output
parse and generate ELSE clause