From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 2 Dec 92 03:42:38 GMT From: ucivax!gateway@ucbvax.Berkeley.EDU (Kenneth Anderson) Subject: Exception'IMAGE in Ada9X? Message-ID: <9212011938.aa08479@Paris.ics.uci.edu> List-Id: Hi, Does anyone know if they plan to have a feature in Ada9X that would get rid of code that looks like this... procedure Buggy is begin ... exception when CONSTRAINT_ERROR => Text_IO.PUT_LINE("CONSTRAINT_ERROR in Buggy"); when NUMERIC_ERROR => Text_IO.PUT_LINE("NUMERIC_ERROR in Buggy"); when STORAGE_ERROR => Text_IO.PUT_LINE("STORAGE_ERROR in Buggy"); when others => Text_IO.PUT_LINE("Fatal Error in Buggy"); end Buggy; and replace it with something like procedure Buggy is begin ... exception when others => Text_IO.PUT_LINE(exception'IMAGE); end Buggy; Notes: The above code does not imply that only buggy code should have exception handlers. I realize that I used 'IMAGE in the wrong fashion. I.E. Normally you would see something like T'IMAGE(Var_of_type_T). I just wanted to convey the notion of being able to print out what the exception is without coding a seperate when statement for all possible exceptions (including user defined exceptions). Thanks in advance, Ken Anderson