UNDO, THROW Error Handling (-undothrow)
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
Change the default error handling to UNDO, THROW in routine
or other blocks.
| Operating system and syntax | UNIX / Windows |
-undothrow
n
|
||
|---|---|---|---|---|
| Use with | Maximum value | Minimum value | Single-user default | Multi-user default |
| Client Session | 2 | 1 | — | — |
- n
- A value (either 1 or 2) that specifies whether you want to change the
default error-handling to
UNDO,THROWfor routine-level blocks only, or for other blocks as well.Set n to 1 to change the default behavior for routine-level blocks only. Routine-level blocks include the main block of an external procedure (.p), internal procedures, user-defined functions, methods of a class, class constructors, property accessors, and
ONblocks used as database triggers withCREATE,DELETE,WRITE, orASSIGNevents.Set n to 2 to change the behavior for
REPEAT,FOR, andDO TRANSACTIONblocks in addition to all of the routine-level blocks.Any value other than 1 or 2 will throw an error and terminate the session.
-undothrow startup
parameter has no effect on r-code. Error handling cannot be changed after code is compiled.
The -undothrow parameter takes effect only during a compile
of .p or .cls source files.An alternative to the -undothrow startup parameter is to add either ROUTINE-LEVEL ON ERROR UNDO, THROW or BLOCK-LEVEL ON
ERROR UNDO, THROW statements to your source files. For more information about
these statements, see ABL Reference.