Try OpenEdge Now
skip to main content
Error Handling
Handling Errors with CATCH Blocks : Blocks that support CATCH blocks
 

Blocks that support CATCH blocks

The following blocks can have a CATCH block:
*DO (if configured with TRANSACTION or ON ERROR, UNDO)
*FOR
*REPEAT
*CATCH
*FINALLY
*Procedure (.p file)
*Internal procedures
*User-defined functions
*ON blocks
*Constructors
*Destructors
*User-defined methods
*Property accessors
One or more CATCH blocks are positioned at the end of the associated block. If a FINALLY block is also used, the CATCH block comes before the FINALLY block. This is the syntax for an associated block using end blocks:

Syntax

associated-block:
  .
  .
  .
  [ CATCH
    .
    .
    .
  END [ CATCH ] . ]...
  [FINALLY
    .
    .
    .
  END [ FINALLY ] . ]
END. /* associated-block */