It sounds like old-style BASIC exception handling.
ON ACCIDENT GOTO EMERGENCYROOMOr modern JavaScript event handling. Button.onAccident(function() { ... });
Re:“On Accident” or “By Accident”?
by unfamiliar on Thursday September 24, 2015 @09:42AM
(#10271497)
Except that's not how it is used, it is used in place of "by accident."
"I knocked over the glass on accident."
"on accident" is a pre-prepared behavior that will be employed when an accident occurs in the future.
"by accident" is metadata accompanying an event, reporting the author or agent that created the event.