note 14401 deleted from class.pear-error by nlopess

From: Date: Sat, 26 Jun 2004 11:37:42 +0000
Subject: note 14401 deleted from class.pear-error by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-71749@lists.php.net to get a copy of this message
Note Submitter: tychay@mac.com ---- Some minor notes here. First, PEAR_Error is located in PEAR.php, not PEAR/Error.php as the coding standard specifies. Second, very rarely would you need to actually called anything in PEAR_Error. Virtually anything you want is already abstracted for you in PEAR. In particular PEAR::isError() to test for an error. Another example, you might want to output something like... if ($result=PEAR::IsError($somepearobject->somepearmethod())) { echo $result->toString(); } which will echo the error to the screen. However, there are already great debugging handlers in PEAR in the form of setErrorHandling() and raiseError(). However if you must write to the screen there are accessors built into PEAR_Error that will give you anything you might need. Combine both debugging and manual error handling with output buffering for some pretty powerful error pages that are informative and alert you to bugs in your web applications. -terry cahy

« previous php.notes (#71749) next »