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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID,XPRIO autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,257f84dada6fa64a,start X-Google-Attributes: gid103376,public From: "David C. Hoos, Sr." Subject: Propagation of unhandled exceptions during elaboration, in a tasking program Date: 1999/11/01 Message-ID: <7vjvb3$kn5$1@hobbes2.crc.com>#1/1 X-Deja-AN: 543058562 X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Complaints-To: abuse@crc.com X-Trace: hobbes2.crc.com 941457571 21221 205.149.48.21 (1 Nov 1999 11:59:31 GMT) Organization: CRC: A wholly owned subsidiary of Thermo Electron X-MSMail-Priority: Normal NNTP-Posting-Date: 1 Nov 1999 11:59:31 GMT Newsgroups: comp.lang.ada Date: 1999-11-01T11:59:31+00:00 List-Id: Hi all, I have a question about the expected behavior of an Ada program when an unhandled exception is raised during elaboration, and other tasks (at least threads) are running. The context is this: I have a package called Configuration_Data that exports a number of parameterless functions that return values used in the declarations of various items -- e.g. the block_size and block_count for storage pools, etc. This package obtains the values returned by these functions from a text file that is opened and read during the elaboration of the package body. An exception block surrounds the call to open the file, and any exception is re-raised with added exception information: e.g. "attempting to open file """ & Filename & """." This scheme has worked well, giving the use an informative error message if the configuration file cannot be opened. However, in a tasking program, several threads have been started by the time Configuration_Data is elaborated, and the exception information is not written to the standard output nor to the standard error file, if the file cannot be opened. I "worked around" the problem, by, instead of re-raising the exception, writing the informative message to the standard error file, and calling POSIX.Process_Primitives.Exit_Process. Now, the user sees what's wrong, and knows what corrective action to take. My question is this -- is the behavior I've described what is expected from an Ada program?