Progress.Lang.AppError class

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. Representing a user-defined error as an error object allows your application to throw and catch or return an error in the ABL structured error handling model. An application can use the built-in AppError class directly or can create objects that inherit from this class to provide extra error or contextual information

An application error can be raised either by using the RETURN ERROR or the UNDO, THROW statement. See Raise Conditions for details on how to throw an application error.

The following table describes additional properties and methods of this class beyond what is required by the Progress.Lang.Error interface, which this class implements.

Table 1. AppError properties and methods
Member Description
ReturnValue property This property is included in the AppError object to provide a bridge between the older functionality of RETURN ERROR ErrorString and error objects. Traditionally, this form of the RETURN ERROR statement populated the data for the RETURN-VALUE function. Now, the AVM also generates an AppError and populates the ReturnValue property. That way the same information is available if this error object is caught. Without using CATCH blocks, the ErrorString is still available in the traditional way, via the RETURN-VALUE function.
Severity property Although the Severity property is an inherited property, it is intended as a feature of AppError objects and is not used by SysError objects. Severity has no intrinsic meaning to ABL. You can use it to establish a severity ranking system in your application.
AddMessage(ErrorMessage, MessageNumber) method Adds a message to the AppError object with values from the ErrorMessage and MessageNumber arguments to the end of the message list. Your application provides the message number and text. Access error messages and message numbers with the GetMessage() and GetMessageNum() methods.This method increments the NumMessages property on the AppError by 1.
RemoveMessage(MessageIndex) method Removes the error at the specified index position (both error message string and error message number) from the message list. The method decrements the NumMessages property by 1 and moves the messages after the indexed error forward in the list by 1.