2009/10/2 Alex Schenkman <alex@schenkman.info>:
Igor, I'm trying to understand your suggestion. Am I thinking correclty? Thanks in advance! On Thu, Oct 1, 2009 at 23:42, Igor Stasenko <siguctua@gmail.com> wrote:
How about a visitor pattern?
[ a block of code where you do something that can singal different exceptions  ]   on: Error do: [:ex | ex visitWith: self ]
I had to replace self with a class handling the errors: [ZeroDivide new signal: 'zero'] Â Â Â on: Error do: Â [:error | error visitWith: (MyErrorHandler new)].
Error>>visitWith: anErrorHandler    ^ anErrorHandler handleError: self
MyErrorHandler>>handleError: anError    ^anError signal
Error subclass: #AlexError AlexError>>visitWith: anErrorHandler    ^ anErrorHandler handleAlexError: self AlexError>>handleAlexError: anAlexError    ^'Handling an AlexError now.'
yes, something like that
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.