[Pharo-project] Improving Pharo's Exception Hierarchy
Sven Van Caekenberghe
sven at beta9.be
Thu Apr 14 20:38:21 CEST 2011
I think I understand some of your points, there based on valid concerns. We should end up with a minimal set of exceptions. The current set was not that large IMHO. But here and there some simplifications are possible.
Thanks for submitting a concrete alternative hierarchy.
However, it feels as if the reasons between using a class and a selector are a bit arbitrary. I can't make sense out of it.
Another thing that hasn't been discussed so far is what data should go in each exception.
This has to be done on a blackboard with a couple of people. And it won't be finished in one go either, far from it.
I'll print out your hierarchy as well !
On 14 Apr 2011, at 18:07, Dale Henrichs wrote:
> Using Sven's hierachy as a starting point and taking some cues from the GemStone exception hierarchy, I would suggest the following (names atarting with # are reasonCodes in the namespace of the parent exception class, instead of a unique class):
> Exception (messageText reasonCode)
> ZeroDivide (dividend)
> FileStreamException (fileName)
> #fileExistsException (fileClass)
> #fileReadError **
> #fileClosedException **
> #cannotAccessFileException **
> #readonlyFileException **
> MessageNotUnderstood (message, receiver)
> #nonBooleanReceiver (object)
> OutOfMemory < handlers?>
> SyntaxError ** !exists! (input, position)
> #numberFormatException **
> #headlessError **
> TimedOut ** (object, operation, timeout)
> IllegalOperation ** (operation, object)
> #sizeMismatch (objects)
> #subclassResponsibility ** (message, receiver)
> #notYetImplemented ** (message, receiver)
> #cannotInstanciate ** (class)
> #readOnlyObject ** (object)
> OutOfFreeSpace ** <handlers?>
> #invalidArgument ** (message, receiver, argument)
> #notIndexable ** (object)
> #noKeyedAccess ** (object)
> #nonIntegerIndex ** (receiver, index)
> #subscriptOutOfBounds ** (receiver, index, from, to)
> NotFoundException ** (receiver, object)
> #keyNotFound **
> #valueNotFound **
> #elementNotFound **
> StreamException (stream)
> #positionError ** (index, from, to)
> EndOfStream **
> #beginOfStream **
> LowMemory ** <this should be a notification not an error>
More information about the Pharo-project