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 OpenEdge Development: ABL Error Handling, for more information.
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.