ROUTINE-LEVEL ON ERROR UNDO, THROW statement
- Last Updated: July 26, 2022
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
The ROUTINE-LEVEL ON ERROR UNDO, THROW
statement is very similar to BLOCK-LEVEL ON ERROR UNDO,
THROW, but it affects only a subset of block types. Specifically, this statement
changes the default behavior for the following blocks:
- Procedure (also called main block, external procedure, or .p file, including database trigger .p files)
- Internal procedure
- Database trigger (
ONblock withCREATE,DELETE,WRITE, orASSIGNevent) - User-defined function
- Constructor
- User-defined method
- User-defined property getter/setter
The following blocks are not affected:
- Any block for which an error-handling directive is explicitly specified
-
REPEAT -
FOR -
DO TRANSACTION - Simple
DOblock DO WHILEblock- Destructor
- UI trigger
Syntax
|
The same rules that affect the placement of
the BLOCK-LEVEL ON ERROR UNDO, THROW statement
also apply to ROUTINE-LEVEL ON ERROR UNDO, THROW:
- The statement occurs once in each .p or .cls file in which the behavior is desired.
- The statement must come before any definitional or executable statement in the procedure or class file.
- The statement can come before or after a
USINGstatement.
Note: The
ROUTINE-LEVEL ON ERROR UNDO, THROW statement
is ignored if BLOCK-LEVEL ON ERROR UNDO, THROW occurs
in the same file.