I enjoyed the chapter :-). It was very informative, and illustrated yet again how flexible Smalltalk can be. Is there any particular reason why this 'essential' chapter was not included in the first edition of Pharo by Example?
- It was not written - we want to have a cool second volume and - pharo by example can already get out for other languages using squeak by example translation, so we do not want to force translater that already translate squeak by example to have to translate too many new chapters.
I also have a question about the contents. In chapter '1.14 Catching sets of exceptions' it is explained how catch a set of exceptions but not how to define a different handler on each exception. For instance i want to handle a more specific FileDoesNotExistException in a different way than a more general FileStreamException, or even Exception. The way i can do this, i see, is to test which type of exception is coming into the do: block and execute appropriate code. This is a very bad solution. Or secondly, to create nested on: do: blocks with the most specific exception as inner block. This seems better, but is kind of verbose. Is there another way to solve this problem?
Kind regards,
Bart
2009/11/23 Stéphane Ducasse <stephane.ducasse@inria.fr>
Enjoy I had a lot of fun writing it when my family went to the swimming pool and I could concentrate :)
Stef
On Nov 23, 2009, at 9:05 AM, Bart Gauquie wrote:
Dear all,
I've been searching the Pharo by Example book about how to handle Exception, Error, ... in Pharo.
I've found some information about it in the SUnit chapter, in method 7.11: Catching test case errors and failures; this is only a small fragment however.
Is there any chapter planned about this topic? It would be very useful i think, since it is an important topic, and I've read that Smalltalks exception handling is very powerful, but I don't know much about it and like to learn it.
Kind Regards,
Bart
-- imagination is more important than knowledge - Albert Einstein Logic will get you from A to B. Imagination will take you everywhere - Albert Einstein Learn from yesterday, live for today, hope for tomorrow. The important thing is not to stop questioning. - Albert Einstein The true sign of intelligence is not knowledge but imagination. - Albert Einstein Gravitation is not responsible for people falling in love. - Albert Einstein _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- imagination is more important than knowledge - Albert Einstein Logic will get you from A to B. Imagination will take you everywhere - Albert Einstein Learn from yesterday, live for today, hope for tomorrow. The important thing is not to stop questioning. - Albert Einstein The true sign of intelligence is not knowledge but imagination. - Albert Einstein Gravitation is not responsible for people falling in love. - Albert Einstein _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project