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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a3ca574fc2007430 X-Google-Attributes: gid103376,public From: James Rogers Subject: Re: When to raise predefined exceptions (was: Ada and the Automotive Industry) Date: 1996/12/20 Message-ID: <32BAEE39.773C@velveeta.apdev.cs.mci.com>#1/1 X-Deja-AN: 205288648 references: content-type: text/plain; charset=us-ascii organization: MCI Telecommunications Colorado Springs, CO mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.0 (X11; I; AIX 2) Date: 1996-12-20T00:00:00+00:00 List-Id: Ted Dennison wrote: > I guess that is what I was getting at. There have been times where I > wanted to consider certian values out of range for a type, but the only > way to do it was to explicitly check for those values. It seemed > pointless to create a new exception to raise, when any reasonable > handler for this situation would just have to handle *both* > Constraint_Error and my new exception. > I see your point, however it is possible to design away this problem by handling CE in the subprogram in which it is raised by raising your new exception. This way calling subprograms would only encounter your new exception. If you use Ada.Exceptions you can indicate what really happened in the Exception_Information string. The handler for your new exception could direct its behavior based upon both the exception name and the exception information, if such fine control were deemed necessary. -- Jim Rogers ************************************************************* Team Ada