Hey,
What I've seen so far and I like is to use small helper methods to signal exceptions:
"usage"
Dictionary >> at: aKey
...
self keyNotFound: aKey.
"helper method to fill the exceptions params"
Dictionary >> keyNotFound: aKey
KeyNotFoundException signalWithKey: aKey
"helper to signal an Exception"
KeyNotFoundException class >> signalWithKey: aKey
self new
key: aKey;
signal.
At least one of the helper methods should be present to make the code more readable, I think.
And as Mariano pointed out, there should be a convention on the naming: I am still not sure about suffixing the exception classes with "Exception", but I guess this is a good thing to do. Though I must say that I omitted it so far ;) and just put the verb there, but that can be easily changed.
The exception hierarchy looks nice ;), I think in this matter we can learn a bit from Java.
And I would certainly like to see these error messages infect the whole system ;).
camillo
On 2011-04-13, at 11:03, Sven Van Caekenberghe wrote: