From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,INVALID_MSGID, LOTS_OF_MONEY,PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,790d824907970cc3 X-Google-Attributes: gid103376,public From: "David C. Hoos, Sr." Subject: Re: Exception Propagation Date: 1999/06/08 Message-ID: <7jjqi6$mk6@hobbes.crc.com>#1/1 X-Deja-AN: 487193176 References: <7jjbl4$n79$1@nnrp1.deja.com> <7jh857$ej$1@nnrp1.deja.com> <375CC549.7EDFB885@spam.com> <0nc73.5376$y6.3195132@WReNphoon3> Organization: Coleman Research Corporation X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3612.1700 Newsgroups: comp.lang.ada Date: 1999-06-08T00:00:00+00:00 List-Id: Decker, Christian R wrote in message <0nc73.5376$y6.3195132@WReNphoon3>... >OK, everyone is mis-understanding my question, and i apologize..... >I understand that when an exception is raised in a task that it is not >deterministic as to where the exception gets >propagated as far as being able to trap and handle it. > It _is_ deterministic. Hear what the RM (11.4) says (note especially 11.4 (4): 3 When an exception occurrence is raised by the execution of a given construct, the rest of the execution of that construct is abandoned; that is, any portions of the execution that have not yet taken place are not performed. The construct is first completed, and then left, as explained in 7.6.1. Then: 4 � If the construct is a task_body, the exception does not propagate further; 5 � If the construct is the sequence_of_statements of a handled_sequence_of_statements that has a handler with a choice covering the exception, the occurrence is handled by that handler; 6 � Otherwise, the occurrence is propagated to the innermost dynamically enclosing execution, which means that the occurrence is raised again in that context. >But as far as seeing text displayed in the console window indicating that an >excpetion was raised should always >occur, at least in every other Ada compiler i have used. My problem is that >i see no text, or any other indication >that an exception is being raised. I know there is an exception because i >tested using an explicit trap to display >the error. I don't want random exception handles, i just want to be >notified via text in the console that an >exception has occured. > "Ada 95 Quality and Style: Guidelines for Professional Programmers" has guidelines that explicitly address this issue, viz.: Provide a handler for exception Program_Error whenever you cannot avoid a selective accept statement whose alternatives can all be closed (Honeywell 1986). Make systematic use of handlers for Tasking_Error. Be prepared to handle exceptions during a rendezvous . Consider using a when others exception handler. Consider using an exception handler for a rendezvous within the main loop inside each task. Place an exception handler for others at the end of a task body. Consider having each exception handler at the end of a task body report the task's demise. >So with that does anyone know why i am not getting text messages telling me >an exception was raised? > Yes .. because If the construct is a task_body, the exception does not propagate further.