Try OpenEdge Now
skip to main content
Error Handling
Raising errors with THROW : THROW as a default for blocks
 

THROW as a default for blocks

For those who want to apply the THROW directive broadly for a file (procedure or class) or for an entire application, OpenEdge provides options that make UNDO, THROW the error-handling behavior for blocks where no explicit directive is specified and default behavior (UNDO, RETRY or UNDO, LEAVE, depending on the block type) would otherwise be in effect. These options are:
*BLOCK-LEVEL ON ERROR UNDO, THROW statement
*ROUTINE-LEVEL ON ERROR UNDO, THROW statement
*-undothrow n startup parameter
For troubleshooting and other purposes, it is important to be able to determine whether a given piece of compiled code uses one of these directives. To support this requirement, the AVM records usage of the block-level and routine-level error-handling statements in:
*An attribute of the RCODE-INFO system handle
*XREF and XREF-XML output
* BLOCK-LEVEL ON ERROR UNDO, THROW statement
* ROUTINE-LEVEL ON ERROR UNDO, THROW statement
* -undothrow n startup parameter
* Determining error-handling characteristics of r-code