Progress.Lang.AppError class
- Last Updated: January 18, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
Progress.Lang.AppError is the super class of all
application errors. An application error is simply any
collection of data you need to provide necessary information about a condition.
An application error can be raised either by using the RETURN ERROR or the UNDO, THROW
statement.
The following figure represents the hierarchy of ABL classes that provide
Progress.Lang.AppError with all its features:

Progress.Lang.ProError is the super class of all error
objects in ABL. From Progress.Lang.Object it inherits the
basic features of an ABL class. It also implements the Progress.Lang.Error interface which provides the basic properties and methods
for handling errors.
Progress.Lang.AppError adds the properties and methods
needed for populating an AppError object with your error
messages.
You can create your own hierarchy of more complex AppError types by creating subclasses of AppError.
When the AVM encounters the RETURN ERROR
statement, it implicitly throws a Progress.Lang.AppError
object and places any error string in the object's ReturnValue property. ReturnValue is included
in the AppError object to provide a bridge between the
older functionality of RETURN ERROR ErrorString and error objects. See ABL Error
Handling, for more information.
Serializable:
Yes
Constructors
The following is the default constructor. This constructor creates an
AppError object with an empty message list and does not
set any properties.
|
The following constructor creates an AppError object and assigns the first message on the object with the values from
the ErrorMessage and MessageNumber arguments. It also sets the NumMessages property to 1. This error message and message number can be accessed
with the GetMessage(1) and GetMessageNum(1) methods.
|
The following constructor creates an AppError object with the ReturnValue property
set with the value of the ReturnValue parameter. This
constructor is used when the AVM implicitly creates an AppError object for a RETURN ERROR
ErrorString statement. You can also invoke this
constructor directly (not common).
AddMessage() method is not used to
set one, no message is displayed if an object constructed this way is thrown and handled by
default error handling.
|
Interfaces
This class does not implement interfaces (beyond those it inherits from its base class).
Public Properties
| ReturnValue property | — | — |
Public Methods
| AddMessage( ) method | RemoveMessage( ) method |
Public Events
This class does not contain events.
Notes
- All
AppErrorinstances, both those created implicitly and user-defined application errors, created with the NEW function (classes) appear on theSESSION:FIRST-OBJECTchain, just like any other user-defined object.