Re: Standardized way of interpolating variables into PEAR_Exceptionmessages?
| From: | Alexey Borzov | Date: | Mon, 25 Sep 2006 13:55:06 +0000 |
| Subject: | Re: Standardized way of interpolating variables into PEAR_Exceptionmessages? | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-44051@lists.php.net to get a copy of this message | ||
Hi,
Greg Beaver wrote:
BTW, I don't think it is a good idea to use PEAR::isError() there: http://cvs.php.net/viewvc.cgi/pear-core/PEAR/Exception.php?r1=1.23&r2=1.24 since PEAR class can be undefined. What about if (class_exists('pear_error', false) && $message instanceof PEAR_Error) ?Trivial conversion can be done via throw new Foo_Exception($error->getMessage()); or the equivalent for PEAR_ErrorStack. As for automatic conversionHi, As a side note, even this is unnecessary, as of PEAR 1.5.0, PEAR_Exception will be able to directly accept either a PEAR_Error
In other words, this is not an issue whatsoever, the API of PEAR_Exception has solved both of these problems without need for political intervention.