|
> Maybe a new exception class is better than Error, but i do not take this
responsability alone.
[value1 := Number readfrom: aStream.
value2 := Number readFrom: aStream]
on: NumberReadError do: [:exc | global handler block]
Hi Nicolas, I just wanted to say I think your reasoning is compelling and I see nothing wrong with creating a new Error subclass if its really needed. A lot better than resorting to looking at the messageText in the handler!
You might consider a slightly more generic error, like ParseError or something..
Regards,
Chris
|