Re: PEAR's Error Handling and PHP5
| From: | Greg Beaver | Date: | Wed, 21 Jun 2006 21:04:15 +0000 |
| Subject: | Re: PEAR's Error Handling and PHP5 | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-43078@lists.php.net to get a copy of this message | ||
Hans Lellelid wrote:
> There is an exception to that, I think, though, and that is for methods
> like getWarnings() or getErrors() or places where you explicitly are
> expecting to get some Exception-looking non-exceptions (or collection of
> them). Of course, we probably would want a PEAR_Warning instead, but
> PEAR_Warning could also extend Exception so that it could be thrown
> under certain circumstances (or maybe PEAR_Exception would accept a
> PEAR_Warning as a constructor param, etc.). That seems like a different
> discussion (and one, I know, that has been had before), also it sounds
> like some of this need has been addressed by trigger_error taking
> objects (is that for PHP6?).
Proof of concept of PEAR_Warning has been collecting dust in
pear-core/PEAR/Warning.php for over a year, in case anyone is interested.
Main features are that it allows easy migration back and forth between
PEAR_Exception and PEAR_ErrorStack, as well as not actually requiring
that the PEAR/Warning.php file be included unless needed.
Greg