Try OpenEdge Now
skip to main content
Error Handling
Introduction to Condition Handling : Traditional error handling : Custom error handling
 

Custom error handling

While the NO-ERROR option can be used to suppress errors you want to ignore, it is more frequently used when you want to:
*Override the default error handling
*Suppress your customer from seeing the default error message
*Provide custom code to handle the particular system error
*Test the ERROR-STATUS system handle to determine if a particular error occurred
In this simple example, the custom error handling creates a custom error message by outputting the standard error message to the run-time message area of the procedure window:
FIND FIRST Customer WHERE CustNum = 1000 NO-ERROR.

IF ERROR-STATUS:ERROR = TRUE THEN
MESSAGE ERROR-STATUS:GET-MESSAGE(1).