Fw: Fun with Number readFrom: What should we do ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Fw: Fun with Number readFrom: What should we do ?

Chris Muller
> 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