title: Raising several run time errors in progress 4GL
body: <p>I want to test some AppServer error handling in progress. However, in order to test it I would like a run-time error with num-messages >= 2. How can you generate such multiple errors?</p>
  
  <hr>
  
  <p>Here are some samples of what I am trying to do</p>
  
  <pre><code>IF ERROR-STATUS:ERROR THEN      
     LogToAppserver().
  </code></pre>
  
  <p>and </p>
  
  <pre><code>CATCH e AS Progress.Lang.Error :
      LogToAppserver(e).
  END CATCH.  
  </code></pre>
  
  <p>where LogToAppserver looks like </p>
  
  <pre><code>METHOD PRIVATE VOID LogToAppserver(  ):
  
      DEFINE VARIABLE locNumErrors AS INTEGER NO-UNDO.
  
      locNumErrors = ERROR-STATUS:NUM-MESSAGES.
  
      DO WHILE locNumErrors &gt; 0:
          MESSAGE ERROR-STATUS:GET-MESSAGE (locNumErrors).
          locNumErrors = locNumErrors  - 1.
      END.
  
      RETURN.
  
  END METHOD.
  
  METHOD PRIVATE VOID LogToAppserver( INPUT iError AS Progress.Lang.Error ):
  
      DEFINE VARIABLE locNumErrors AS INTEGER NO-UNDO.
  
      locNumErrors = iError:NumMessages.
  
      DO WHILE  locNumErrors &gt;0:
  
          MESSAGE iError:GetMessage(locNumErrors ).
  
          locNumErrors  = locNumErrors - 1.
  
      END. 
  
      RETURN.
  
  END METHOD.
  </code></pre>