Progress
Programming
Handbook
Default Handling
When the ERROR condition occurs anywhere outside of a trigger block, Progress follows these steps:
FOR EACH blocks, REPEAT blocks, and procedure blocks automatically have the error property. This means that each of these blocks implicitly has the ON ERROR UNDO, RETRY phrase attached to it. The following two examples are the same:
A DO block has the error property if its header contains the TRANSACTION keyword or the ON ERROR phrase.
When the ERROR condition occurs within a database trigger block, Progress follows these steps:
The following example shows how Progress handles a processing error:
p-error.p
![]()
If Progress is not handling a specific processing error the way you want, you can override automatic error handling by handling the error yourself.
Progress has no predefined ERROR key. However, you can define any control key or other special key as the ERROR key. Then, when the user presses that key at an input prompt, the procedure does error processing.
The next example demonstrates what Progress does when the user presses a defined ERROR key:
p-txn6.p
![]()
The ON statement defines F9 as the ERROR key. That is, when the user presses F9, Progress raises the ERROR condition, searches for the closest block that has the error property and undoes and retries that block.
NOTE: If you do not have an F9 key on your keyboard, you can modify this procedure to name another key, such as F2 or PF2. Or, if your keyboard has no F or PF keys, specify ON CTRL–W ERROR to assign ERROR to the CTRL–W keys.When you run this procedure, the INSERT statement displays a screen similar to this:
![]()
If you press F9, Progress follows these steps:
In this case, Progress undoes and retries the transaction block.
If you run the
p
-txn6.p
procedure again, and press F9 during the order–line block, Progress undoes the subtransaction and retries that iteration of the inner REPEAT block.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |