Re: Error supressing in PHP5 [was PEAR_Interop... [was PEAR_Warning...]]
| From: | Hans Lellelid | Date: | Wed, 14 Jul 2004 00:37:21 +0000 |
| Subject: | Re: Error supressing in PHP5 [was PEAR_Interop... [was PEAR_Warning...]] | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-32001@lists.php.net to get a copy of this message | ||
Hi Jon,
Jon Wood wrote:
On Tue, 13 Jul 2004 15:06:54 -0700, Justin Patrin <papercrane@gmail.com> wrote:set_exception_handler() is designed to catch those exceptions which reach the top, yes. The discussion before was a result of the suggestion (by Lukas) that a weakness of using exceptions is that you cannot disable them altogether. The argument is that developing applications is faster when you can turn off error handling, so that essentially throw new Exception() is just ignored. Obviously I'm very skeptical and don't seen any good reason to add the extra layer of abstraction (the extra code & coding requirement) that would make this possible in PEAR. HansUnless all of the refs I found from google are wrong (this isn't in the docs yet...argh!), this function is only called when an exception reaches the top level uncaught. This would mean that the stack has already been unraveled, so this wouldn't work unless it: 1) is run for *every* exception 2) allows for stopping an exception form being thrown (ie, re-throw the exception or return true if you want the exception to keep going)Isn't the only ones that are a problem the ones that get to the top level without being caught anyway - if you've already caught an exception then you obviously aren't worried about it needing to be suppressed anyway.