Re: exceptions
| From: | Greg Beaver | Date: | Wed, 09 Jun 2004 23:48:12 +0000 |
| Subject: | Re: exceptions | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-30348@lists.php.net to get a copy of this message | ||
Martin Jansen wrote:
PEAR_ErrorStack might become handy here, because it seems to come with a much smaller memory footprint than PEAR_Error. Greg should know the details here.PEAR_ErrorStack does not instantiate ANY objects when an error occurs, except an Exception, which it returns. It does not throw the exception, leaving that up to the caller of push(). It does, however, run a debug_backtrace(). This can be disabled in the final application very easily, however. PEAR_ErrorStack is a drastically different model from PEAR_Error. PEAR_Error attempts to combine error raising and error handling into instance-based objects using mainly static calls (PEAR::raiseError()). PEAR_ErrorStack instantiates a repository for all error messages, codes, and information, and provides easy logging capabilities. It also easily supports any existing global error raising/handling solution already out there including PEAR_Error, trigger_error(), exceptions, and also any new ones, because it does not attempt to limit the error to a particular object, but stores it as an array that can be manipulated with callbacks. Greg