-catchStop 1

Posted by Roger Blanchard on 03-May-2019 13:29

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.

All Replies

Posted by Laura Stern on 03-May-2019 13:43

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.

Posted by Roger Blanchard on 03-May-2019 13:56

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.

Posted by Roger Blanchard on 03-May-2019 13:59

In the REPEAT we are calling waitForMessages in the jms adapter which is throwing a STOP

RUN waitForMessages IN hSession("GetKeepAlive", hMessageHandler, 15).

Posted by Laura Stern on 03-May-2019 14:07

If you are using 11.7, you must opt in to this feature by using the -catchStop 1 startup parameter.  

Posted by Roger Blanchard on 03-May-2019 14:12

yep, we have that in our startup parameter file.

Posted by Fernando Souza on 03-May-2019 14:19

You would need to catch a Progress.Lang.Stop for stops conditions like that.

Posted by Roger Blanchard on 03-May-2019 14:22

Okay, thanks for the info.

Posted by Terry Jackson on 03-May-2019 15:00

Hi Roger,
 
If the condition is a Progress.Lang.StopError then your CATCH  for Progress.Lang.Error should catch it. If the condition is a STOP (Progress.Lang.Stop)  then it will not catch it.
You may need to add a CATCH for Progress.Lang.Stop.
 
Best regards,
Terry
 

Posted by Roger Blanchard on 03-May-2019 15:54

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)

Posted by Laura Stern on 03-May-2019 15:54

Sorry, does the jms adapter use the STOP statement to “throw a stop”?  Then yes, you need Progress.Lang.Stop.

This thread is closed