NICE-ESG-Libs Digest Mon, 27 Nov 95 Volume 1 : Issue 308
Today's Topics:
Exceptions
NICE Eiffel Standards Group -- Library Committee Mailing List
To post to list:
NICE-ESG-Libs@atlanta.twr.com
To send mail to the Chairman of the committee:
NICE-ESG-Libs-chair@atlanta.twr.com
Administrative matters (sign up, unsubscribe, mail problems, etc):
NICE-ESG-Libs-request@atlanta.twr.com
Date: Mon, 27 Nov 1995 08:07:30 +0000 (GMT)
From: Paul Johnson +44 1245 242244 <paul.johnson@gecm.com>
Subject: Exceptions
To: NICE-ESG-Libs
I agree with Roger that exceptions should pass an object to the rescue clause,
rather than just a string. At present the only way to get this kind of
supplementary information is to create an object with a "once" function and use
that to store the data. This works, but is a bit kludgy.
However I disagree with the proposed inheritance hierarchy. A class of unique
integers would be far better: after all the most common thing for the handler
to do is a discrimination on the type of the exception. The reason for having
an object is that applications can inherit from a simple EXCEPTION class and
add supplementary information that an exception handler can pick up if it
wishes. For example a comms package might generate an exception when a link
goes down. The exception object can carry data about the nature of the
failure, which can then be picked up by the clients if they want to know about
it.
Paul.

|
|