Re: Re: ErrorStack problems
| From: | Dan Rossi | Date: | Fri, 01 Apr 2005 05:28:16 +0000 |
| Subject: | Re: Re: ErrorStack problems | ||
| References: | 1 2 3 4 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-18461@lists.php.net to get a copy of this message | ||
On 01/04/2005, at 3:13 PM, Greg Beaver wrote:
Sorry I wasnt clear, I want to personally use PEAR_ErrorStack for my personal packages, then also handle Pear_Error within ErrorStack for all the other PEAR packages I use or else I wouldnt be bothering :) This system also runs PHP5 so I would like to see how it works with exceptions in the future. I have only ported this app to a PHP5 environment so most of my classes and the PEAR packages (hehehe) are PHP4 based anyway for now. Currently I have only relied on what PEAR_Error spits out.Nah, the work is in understanding your assumptions and how they differ from the way PEAR_ErrorStack works, as with any new software. Are you using PEAR_ErrorStack for any reason other than handling PEAR_Error? If not, then why not simply use a PEAR_Error callback? PEAR_ErrorStack is designed to make combining code that uses different error handling systems easy, as well as to be used for new projects from scratch. Using it to handle PEAR_Error on its own for no other reason is just going to be awkward.
function errorStack($error)
{
PEAR_ErrorStack::staticPush('MDB2',$error->getCode(),'error',
array('olderror'=>$error),$error->getMessage().\n.$error- getDebugInfo());
}
Which means it would only work for MDB2 , not others like LiveUser, Structures_DataGrid, Excel_Spreadsheet, HTTP_Sessions and what else I decide to implement ?? :| Most importantly LiveUser I would like some of the errors on the login screen , not dying to the page, so what is handled for MDB2 would be better handled alone. And