The following example shows incorrect usage of the NO-ERROR phrase. Since the information in the ERROR-STATUS handle is reset each time it is used, whether an error occurs or not, using it on successive statements, and only checking it at the end of the sequence, may cause the application to lose information and behave incorrectly. To trap any error that occurs in a set of statements, use a CATCH block. See CATCH Blocks for more information.

DEFINE VAR hSocket AS HANDLE. 
DEFINE VAR mem AS MEMPTR. 

CREATE SOCKET hSocket. 
hSocket:CONNECT ("-H localhost -S 3333") NO-ERROR. 
FOR EACH Customer WHERE Customer.Name BEGINS "A": 
    PUT-STRING(mem, 1) = Customer.NAME NO-ERROR. 
    hSocket:WRITE(mem, 1, LENGTH(Customer.Name)) NO-ERROR. 
END. 
hSocket:DISCONNECT() NO-ERROR. 

/* This only tells you if the DISCONNECT call failed. You won’t 
    even know whether the socket ever connected successfully. */ 
IF ERROR-STATUS:ERROR THEN DO: 
    <Handle the error> 
END.