v16.0 introduced a shy result to
[msg] ⎕SIGNAL ⍬that previously had none. Prior to that it was thought to be necessary to place all instances of ⎕SIGNAL within dfns behind guards to avoid the consequences of their not having results when they weren't tiggered.
Since the introducton of the result I've used it a few times in v16.0 forgetting that I had a solution all along that would have worked in v9.0 had I thought of it back then; it actually took me 'til about v11.0 or v12.0.
z←⎕signal/ b ↓ m nwhere m is the error message, n is the error number and b is a boolean scalar indicating no error.
If b is true m is dropped, the argument to ⎕SIGNAL/ is singleton n and reduction runs its operand exactly zero times on such an argument, returning it unchanged, so the dfn can continue.
If false, reduction inserts ⎕SIGNAL between m and n and signals as expected.