Re: PEAR's Error Handling and PHP5
| From: | Patrick Müller | Date: | Wed, 07 Jun 2006 17:24:48 +0000 |
| Subject: | Re: PEAR's Error Handling and PHP5 | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-42834@lists.php.net to get a copy of this message | ||
Nicholas Costa wrote:
Using Exceptions for error control is no more a forced design choice than using PEAR_Error. Personally, I find the PEAR_Error mechanism to be cumbersome and impractical, yet I work with it in order to use PEAR. Exceptions are a clean, trusted mechanism for error handling which is supported in a number of languages, and they are a welcome addition in PHP 5. It would be a mistake not to employ them in PHP 5 PEAR packages. Those who choose not to use them can wrap the package code in a catch-all try-catch block and ignore the Exception, if they wish. Continuing with PEAR_Error is a poor plan that will promote ambiguity among error-handling interfaces. I believe PEAR should standardize on Exceptions for PHP 5 packages.+1 Allowing both is stupid. PEAR_Error style error handling was introduced because the lack of exceptions (or similar handling). Exceptions are simply better At this point PEAR can make a decision to avoid *much* legacy code and angry users. elias