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,631686271a29a357 X-Google-Attributes: gid103376,public From: Laurent.Guerby@enst-bretagne.fr (Laurent Guerby) Subject: Re: Common Error/Exception Handler Date: 1996/04/22 Message-ID: <4xzq84ypq6.fsf@leibniz.enst-bretagne.fr>#1/1 X-Deja-AN: 150851215 distribution: world sender: guerby@leibniz.enst-bretagne.fr references: <4l8d5i$31g@news.sanders.lockheed.com> content-type: text/plain; charset=US-ASCII organization: Telecom Bretagne mime-version: 1.0 newsgroups: comp.lang.ada Date: 1996-04-22T00:00:00+00:00 List-Id: John Cupak: : Wouldn't it be possible with the Ada 95 exception mechanisms to create a : package of standard exceptions and a common error message procedure, : import/rename the exceptions where appropriate, and let the common error : message procedure take care of the details? Robert A Duff wrote: : I suppose it's possible, but it doesn't seem desirable. The abstraction : in question ought to define what sort of things are errors, and what : exceptions are therefore raised. Clients can then decide how to handle : those errors. Why do you think this information ought to be more : global? John Cupak wrote: :I was thinking that a "global error/exception handler" package would be easier : to maintain, since *all* error definitions and messages would be in a single : place. : : Comments? I don't think you (John) are talking about exceptions in general (like Bob), but about exceptions that get propagated to the main unit and are "user" reported as a console message or in a log file. In this last case, a global mechanism is desirable and simple to implement in Ada 95 as a global error reporting package using new Ada (95) features in this area. You should have a look at RM95-A.13, and see that in Ada 95, all IO exceptions are defined in a single package, Ada.IO_Exceptions, and renamed when needed elsewhere ;-). In Ada 95 a message can be associated to an exception occurence, see RM95-11.4.1, Ada.Exceptions. -- -- Laurent Guerby, student at Telecom Bretagne (France), Team Ada. -- "Use the Source, Luke. The Source will be with you, always (GPL)." -- http://www-eleves.enst-bretagne.fr/~guerby/ (GATO Project). -- Try GNAT, the GNU Ada 95 compiler (ftp://cs.nyu.edu/pub/gnat).