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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5bb6410b5c961c45 X-Google-Attributes: gid103376,public From: Jeff Carter Subject: Re: New tools and old exceptions Date: 1997/05/20 Message-ID: <3381AB26.2C4A@spam.innocon.com>#1/1 X-Deja-AN: 242592509 References: <3.0.32.19970519223408.0070cc14@mail.4dcomm.com> Organization: Wouldn't You Like to Know, Inc. Reply-To: carter@spam.innocon.com Newsgroups: comp.lang.ada Date: 1997-05-20T00:00:00+00:00 List-Id: Robert C. Leif, Ph.D. wrote: > > From: Bob Leif, Ph.D. > To: Comp.Lang.Ada > > Many of us need all of the help that we can get. Ada.Exceptions has a > function Exception_Information(X: Exception_Occurrence) return string; > Exception_Occurrence is limited private and no simple information is given > on how to call Exception_Occurrence as an argument based on a name such as > Constraint_Error. > From the error messages that I have been generating, Constraint_Error is an > exception not an Occurrence. > Therefore how does one > Exception > When Constraint_Error => > obtain the Exception_Information on the Constraint_Error? > I am posting this to Comp.Lang.Ada; since, I do not believe that this is a > GNAT problem. > > I would also like to note for the text book authors, that describing in > detail how to maximize the information available in the Ada exception > handler would be appreciated by the students and other readers. > > Thank you. > Bob Leif Check out ARM 11.2, which defines an exception handler: exception_handler ::= when [choice_parameter_specification:] exception_choice {| exception_choice} => sequence_of_statements So you'd want something like exception -- Block_Name when C_E : Constraint_Error => -- Something using Exception_Information (C_E): Text_Io.Put_Line (Item => Ada.Exceptions.Exception_Information (C_E) ); ... -- Other handlers end Block_Name; -- Jeff Carter PGP:1024/440FBE21 Auntie-spam reply to; try ( carter @ innocon . com ) "Now go away, or I shall taunt you a second time." Monty Python & the Holy Grail