Try OpenEdge Now
skip to main content
Error Handling
Introduction to Condition Handling : Traditional error handling : Changing block error handling
 

Changing block error handling

The ON ERROR phrase lets you change the error handling for a DO, FOR, or REPEAT block. For example:
DO ON ERROR UNDO, RETURN:
  FIND FIRST Customer WHERE CustNum = 1000.
END.
If this code were included in an internal procedure or other callable routine, then the failure of the FIND statement leads the AVM to the ON ERROR phrase and the RETURN option. RETURN forces the called routine to terminate and return to the caller.