Re: exceptions
| From: | Justin Patrin | Date: | Tue, 08 Jun 2004 21:26:28 +0000 |
| Subject: | Re: exceptions | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-30227@lists.php.net to get a copy of this message | ||
Greg Beaver wrote:
Justin Patrin wrote:Ok, I was forgetting about ErrorStack for a while. Does it support the same kind of error handling as PEAR_Error? Namely, PEAR_ERROR_RETURN and its ilk? If not, what is offered in its stead? I still think different types of errors (Exceptions or Returning) need to be allowed for different packages to deal with lower level packages' errors as they see fit. -- paperCrane <Justin Patrin>PEAR_Error extends Exception The PEAR_Error could be thrown *as it is* without having to convert between it and some PEAR_Exception. If this is impossible (or hard to do) please tell me. I haven't done any exception handling in PHP yet as I am forced to stick with stable (and mature) versions of PHP for my work.PEAR_Error already extends PEAR. Incidentally, these questions you are raising are all very good, and have been raised before on the list. PEAR_Error is in fact obsolete. Its primary features have been superseded by far superior exceptions and PEAR_ErrorStack. PEAR_ErrorStack can handle PEAR_Errors and convert them into any format you desire, including exceptions, so it acts as a bridge between old code and new code. Others are welcome to continue using PEAR_Error as is, but it will not be further bloated with new features/hacks. Greg