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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bc745b8412f53f25 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-29 12:04:19 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!wn51feed!worldnet.att.net!attbi_s03.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Error-names. References: <2Iq0c.15247$aT1.13123@newsread1.news.pas.earthlink.net> X-Newsreader: Tom's custom newsreader Message-ID: <6Br0c.9876$PR3.199012@attbi_s03> NNTP-Posting-Host: 67.161.24.134 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s03 1078085058 67.161.24.134 (Sun, 29 Feb 2004 20:04:18 GMT) NNTP-Posting-Date: Sun, 29 Feb 2004 20:04:18 GMT Organization: Comcast Online Date: Sun, 29 Feb 2004 20:04:18 GMT Xref: archiver1.google.com comp.lang.ada:5955 Date: 2004-02-29T20:04:18+00:00 List-Id: > > raise; -- we have no code for this exception! re-raise it > However, I think you can't use "raise" here without an exception > name, since we're not necessarily in an exception handler. You could use > Ada.Exceptions.Raise_Exception (E), Oops. Yes. > but I suspect what is really wanted, > based on the OP's earlier messages, is to return General_Error_Code. Agreed. And this was hasty: > > subtype Exception_Codes is Interfaces.C.Int range -10 .. 1; > > > > Coded_Exception_List : constant array(Exception_Codes) > > := (Constraint_Error'Identity, > > Program_Error'Identity, > > Storage_Error'Identity, it should have been subtype Exception_Codes is Interfaces.C.Int range -10 .. -1; Constraint_Error_Code : constant Exception_Codes := -10; Program_Error_Code : constant Exception_Codes := -9; Storage_Error_Code : constant Exception_Codes := -8; ... Coded_Exception_List : constant array(Exception_Codes) := (Constraint_Error_Code => Constraint_Error'Identity, Program_Error_Code => Program_Error'Identity, Storage_Error_Code => Storage_Error'Identity, ... so the compiler can confirm one, and only one, value for each error code.