Try OpenEdge Now
skip to main content
Error Handling
Introduction to Condition Handling : Traditional error handling : Suppressing the ERROR condition
 

Suppressing the ERROR condition

Many ABL statements support the NO-ERROR option. The NO-ERROR option directs the AVM to redirect any failure that would have otherwise raised ERROR. Executing the following example does nothing, and the procedure terminates normally:
FIND FIRST Customer WHERE CustNum = 1000 NO-ERROR.

IF ERROR-STATUS:ERROR = TRUE THEN
MESSAGE ERROR-STATUS:GET-MESSAGE(1).
Information about errors that occurred on a statement with the NO-ERROR option are redirected to the ERROR-STATUS system handle. The MESSAGE statement retrieves the first redirected error message from the system handle and displays it in the message area of the procedure window.