comp.lang.ada
 help / color / mirror / Atom feed
From: James Rogers <jrogers@velveeta.apdev.cs.mci.com>
Subject: Re: When to raise predefined exceptions (was: Ada and the Automotive Industry)
Date: 1996/12/20
Date: 1996-12-20T00:00:00+00:00	[thread overview]
Message-ID: <32BAEE39.773C@velveeta.apdev.cs.mci.com> (raw)
In-Reply-To: mazzanti-0512961053010001@131.114.200.115


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




  parent reply	other threads:[~1996-12-20  0:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-12-05  0:00 Ada and Automotive Industry Franco Mazzanti
1996-12-06  0:00 ` Robert Dewar
1996-12-11  0:00 ` Robert I. Eachus
1996-12-13  0:00   ` Ted Dennison
1996-12-15  0:00     ` Robert Dewar
1996-12-17  0:00       ` Tucker Taft
1996-12-18  0:00       ` Geert Bosch
1996-12-18  0:00       ` Robert A Duff
1996-12-18  0:00         ` Robert Dewar
1996-12-18  0:00           ` Robert A Duff
1996-12-18  0:00             ` Ken Garlington
1996-12-19  0:00               ` Robert A Duff
1996-12-20  0:00                 ` Philip Brashear
1996-12-20  0:00                   ` Robert Dewar
1996-12-22  0:00               ` Robert Dewar
1996-12-23  0:00                 ` Ken Garlington
1996-12-18  0:00       ` Keith Thompson
1996-12-18  0:00         ` Keith Thompson
1996-12-17  0:00 ` Robert I. Eachus
1996-12-20  0:00 ` James Rogers [this message]
1996-12-22  0:00   ` When to raise predefined exceptions (was: Ada and the Automotive Industry) Robert Dewar
1996-12-20  0:00 ` Ted Dennison
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox