Using PEAR_ErrorStack
| From: | Scott Mattocks | Date: | Wed, 15 Mar 2006 13:37:34 +0000 |
| Subject: | Using PEAR_ErrorStack | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-41793@lists.php.net to get a copy of this message | ||
Hello,
I am trying to understand how to use PEAR_ErrorStack so that I can update my proposal for PEAR_PackageUpdate but I am having some trouble. I need to capture errors from other packages and add them to the stack. For example, I have this in my code:
// Check for errors.
if (PEAR::isError($parsed)) {
// Do something with the error...} How can I get that error on to the stack without making calls to getCode, getMessage, etc...? Also, is there a way to make other packages use my error stack? The above code comes from a call to a PEAR_Registry object. I would like to use PEAR::setErrorHandling() but there is no option for PEAR_ErrorStack. Using setErrorHandling(PEAR_ERROR_CALLBACK, array($myStack, 'push')) will not work because the call back must accept a PEAR_Error object. Any help is appreciated. Thanks, -- Scott Mattocks http://www.crisscott.com