Re: Re: cvs: pear-core /PEAR

From: Date: Mon, 06 Sep 2004 19:02:41 +0000
Subject: Re: Re: cvs: pear-core /PEAR
References: 1 2 3 4 5 6 7 8  Groups: php.pear.dev php.pear.core 
Request: Send a blank email to pear-dev+get-33255@lists.php.net to get a copy of this message
Hi, Lukas Smith wrote:
On a related note: Davey's idea on being able to resume inside the exception handler was shot down on internals@.
'Tis a great triumph of forces of reason upon the forces of good!
If we would call our own method to throw any exception we could of course control how and when things get thrown or if at all. This would solve my big gripe that sometimes I want quick and dirty and would therefore like to disable all or selection of exceptions entirely (especially for packages written by rather exception trigger happy people).
There are 2 obvious problems: 1) Useless bloat. People complain now (rightfully) about PEAR_Error, why make them complain about PEAR's wrapper around 'throw'? 2) Let's consider the following. You use class A, which uses class B: class A {
    function doFoo()
    {
         try {
             $this->b->doBar();
             ...
         } catch (PEAR_Exception $e) {
             ...
         }
    }
} If B::doBar() fails, then an exception is thrown and catch {} block is being run. If you switch off exceptions, then execution continues RIGHT AFTER this line, not in catch {} block. Therefore, this situation needs to be handled also, or you'll not get any meaningful result from A::doFoo(). Which means, more useless error handling, which was supposed to be deprecated by exceptions.

« previous php.pear.dev (#33255) next »