Should the following trap the STOP condition?
CATCH e AS Progress.Lang.Error:
END CATCH.
Or do I need to add
CATCH myStopError AS Progress.Lang.StopError:
END CATCH.
You can use Progress.Lang.Error to trap all stop conditions that have an error message, which is essentially all of the unexpected conditions that occur. StopError also works for those, but obviously would not catch normal errors.
You would use a special catch (not StopError), for 4 specific conditions: STOP-AFTER, user interrupt, I.e., CTRL-C, the STOP statement, and, perhaps unfortunately, a lock conflict.
I have the following and it does not seem to catch the STOP.
REPEAT ON ERROR UNDO, THROW:
CATCH e AS Progress.Lang.Error:
END CATCH.
END.
In the REPEAT we are calling waitForMessages in the jms adapter which is throwing a STOP
RUN waitForMessages IN hSession("GetKeepAlive", hMessageHandler, 15).
If you are using 11.7, you must opt in to this feature by using the -catchStop 1 startup parameter.
yep, we have that in our startup parameter file.
You would need to catch a Progress.Lang.Stop for stops conditions like that.
Okay, thanks for the info.
Hmm,
Well it does appear to be a StopError and it does look like the CATCH for the Progress.Lang.Error is catching it. However, if you look at the info from the log file below (the first line) this same info is displayed in the message area of the grey progress form and we do not want it to be. This app is formless and we thought we were trapping all the errors but this creates the grey progress form and displays it at the bottom in the message area. Is there a way to prevent that?
[19/05/03@08:54:56.217-0400] P-002128 T-005540 1 4GL -- (Procedure: 'handleIncommingMsg jms/impl/message-header.p' Line:1425) Invalid or inappropriate handle value given to DELETE OBJECT or DELETE PROCEDURE statement. (5425)
[19/05/03@08:54:56.457-0400] P-002128 T-005540 1 4GL ORS_ERR An Progress.Lang.StopError has occurred:
[19/05/03@08:54:56.457-0400] P-002128 T-005540 1 4GL ORS_ERR Invalid widget handle used in WAIT-FOR statement. WAIT-FOR terminated. (4122)
[19/05/03@08:54:56.457-0400] P-002128 T-005540 1 4GL ORS_ERR wait-for-message jms/impl/msgreceiver.p at line 848 (C:\Progress\OpenEdge\jms\impl\msgreceiver.r)
[19/05/03@08:54:56.457-0400] P-002128 T-005540 1 4GL ORS_ERR waitForMessages jms/impl/session.p at line 2311 (C:\Progress\OpenEdge\jms\impl\session.r)
[19/05/03@08:54:56.457-0400] P-002128 T-005540 1 4GL ORS_ERR UntilShutdown Osprey.Messenger.OspreyDBConsumer at line 2610 (Osprey/Messenger/OspreyDBConsumer.r)
[19/05/03@08:54:56.457-0400] P-002128 T-005540 1 4GL ORS_ERR ReceiveMessages Osprey.Messenger.OspreyDBConsumer at line 1566 (Osprey/Messenger/OspreyDBConsumer.r)
[19/05/03@08:54:56.457-0400] P-002128 T-005540 1 4GL ORS_ERR timer1_Tick Osprey.ReceiverContainer at line 388 (Osprey/ReceiverContainer.r)
[19/05/03@08:54:56.457-0400] P-002128 T-005540 1 4GL ORS_ERR StartReceiver.p at line 451 (StartReceiver.r)
[19/05/03@08:54:56.457-0400] P-002128 T-005540 1 4GL ORS_ERR
[19/05/03@08:54:56.457-0400] P-002128 T-005540 1 4GL ORS_ERR wait-for-message jms/impl/msgreceiver.p at line 848 (C:\Progress\OpenEdge\jms\impl\msgreceiver.r)
[19/05/03@08:54:56.457-0400] P-002128 T-005540 1 4GL ORS_ERR waitForMessages jms/impl/session.p at line 2311 (C:\Progress\OpenEdge\jms\impl\session.r)
[19/05/03@08:54:56.457-0400] P-002128 T-005540 1 4GL ORS_ERR UntilShutdown Osprey.Messenger.OspreyDBConsumer at line 2610 (Osprey/Messenger/OspreyDBConsumer.r)
[19/05/03@08:54:56.457-0400] P-002128 T-005540 1 4GL ORS_ERR ReceiveMessages Osprey.Messenger.OspreyDBConsumer at line 1566 (Osprey/Messenger/OspreyDBConsumer.r)
[19/05/03@08:54:56.457-0400] P-002128 T-005540 1 4GL ORS_ERR timer1_Tick Osprey.ReceiverContainer at line 388 (Osprey/ReceiverContainer.r)
[19/05/03@08:54:56.457-0400] P-002128 T-005540 1 4GL ORS_ERR StartReceiver.p at line 451 (StartReceiver.r)
Sorry, does the jms adapter use the STOP statement to “throw a stop”? Then yes, you need Progress.Lang.Stop.