[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Unsafe error behavior in legacy ABL loops

  • Thread starter Thread starter Lieven De Foor
  • Start date Start date
Status
Not open for further replies.
L

Lieven De Foor

Guest
If the code was written by experienced programmers, they have some catching up to do as the default error processing for a FOR statement is to RETRY (or advance to the next iteration when a retry would cause an infinite loop): From the online help: If you are using a REPEAT block or a FOR EACH block, and an error occurs, all of the processing that has been done in the current iteration of the block is undone, and the AVM retries the block iteration where the error occurred. (If the AVM detects that a RETRY of a FOR or iterating DO block would produce an infinite loop, it performs a NEXT instead. For more information, see OpenEdge Getting Started: ABL Essentials. So this is all expected behaviour... Your current options are: -Add a BLOCK-LEVEL ON ERROR UNDO, THROW statement, which changes the above default behaviour and will cause the whole transaction to be rolled back - Add a DO ON ERROR UNDO, RETURN ERROR block - Add a DO ON ERROR UNDO, RETRY block + IF RETRY block to do error handling - Add a DO ON ERROR UNDO, THROW block + CATCH block.

Continue reading...
 
Status
Not open for further replies.
Back
Top