Handle the ERROR condition
- Last Updated: April 29, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
Your application can encounter an error condition whenever the AVM cannot execute a statement properly, such as trying to find a record that does not exist or create a record with a duplicate value in a unique index. ABL has a built-in error message associated with each such error condition and, by default, displays it (or writes it to an error log on an application server).
For example, if your procedure executes a FIND statement
for a nonexistent Customer, you get the error shown
in the following figure.
The error number in parentheses lets you locate the message number under the Help menu to get more information on the error. It can also help you when you are reporting unexpected errors to technical support.
You can also generate the ERROR condition programmatically
using the RETURN ERROR statement, either as part
of the ON phrase of a block header or as a statement
of its own. If your application has associated a keyboard key with
the ERROR condition then the AVM also raises ERROR when
the user presses that key.
CATCH statement. The two models coexist and
interoperate smoothly with one another. Both forms of error handling are fully documented in
ABL Error Handling.