COBCH1859 Cannot have EXIT ITERATOR inside CATCH or FINALLY block

The program contains an iterator that includes a TRY or FINALLY block with an EXIT ITERATOR statement. This is not allowed.

Resolution:

Correct the code; then recompile.

Example:

In the following example, both TRY blocks are in error as each one includes EXIT ITERATOR.

       class-id A.
       iterator-id MyIterator yielding ret as string.
           try
               continue
           catch
               display "Caught exception"
               set ret to "A"
               exit iterator                           *> Error
           end-try
           try
               continue
           finally
               display "In finally block"
               set ret to "C"
               exit iterator                           *> Error
           end-try
       end iterator.
       end class.