Try OpenEdge Now
skip to main content
Error Handling
Using ABL Error Classes : Progress.Lang.Error interface
 

Progress.Lang.Error interface

The Progress.Lang.Error interface describes a common set of properties and methods that built-in ABL error classes implement to interact with the ABL structured error handling model. This interface cannot be implemented by a user-defined class. Instead, create a subclass of the Progress.Lang.AppError class to create your own type of ABL error object.
The interface defines the properties and methods shown in the following table:
Table 10. Properties and methods
Member
Description
CallStack property
Returns a string representing the call stack at the time the error object was thrown. If the ERROR-STACK-TRACE attribute of the SESSION handle is false, then this property returns the Unknown value (?). To enable the call stack, set SESSION:ERROR-STACK-TRACE property to TRUE directly, or use the -errorstack session startup parameter.
NumMessages property
In ABL, an error is represented as a pair of values. The message number is a unique number identifying the particular error. The error message is a string which describes the error. This property indicates how many error numbers and error messages the error object contains.
Severity property
The Severity property is not used by ABL system errors and returns zero if accessed. It is provided as a mechanism for you to use to assign severity rankings to your various application errors (Progress.Lang.AppError).
GetMessage( MessageIndex ) method
Returns the error message for the indexed error in the error object, beginning with one (1). If there is no error message at the indicated index, the method returns the empty string.
GetMessageNum( MessageIndex ) method
Returns the error message number associated with the indexed error in the error object. For Progress.Lang.SysError and Progress.Lang.SoapFaultError objects, the method returns the message number for the system generated error. If there is no error message at the index, the method returns the empty string.
Specifying Progress.Lang.Error interface in a CATCH statement creates an error handler that catches all possible errors. For example:
DO ON ERROR UNDO, THROW:
  .
  .
  .
  CATCH anyErrorObject AS Progress.Lang.Error:
    .
    .
    .
  END CATCH.
END. /* DO */
* Throwing class-based error objects from an AppServer to an ABL client