The ON_ERROR command can only be used within a BEGINCHECK / ENDCHECK validation block. Refer to these commands for more details of validation blocks.