Re: Re: PHP5: PEAR base Exception classes
| From: | Clay Loveless | Date: | Thu, 17 Jun 2004 14:51:16 +0000 |
| Subject: | Re: Re: PHP5: PEAR base Exception classes | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-30871@lists.php.net to get a copy of this message | ||
On 6/17/04 7:48 AM Pacific Time, Hans Lellelid (hans@velum.net) wrote:
> Hi David,
>
>> I am hardly an "Exceptions expert" (as you already know) but I am
>> writing a new package for PEAR (PHP 5 only)
>> and I am now using throw new Exception (); which result in a pretty
>> ugly message to the user.
>
> Well, the idea is that the exception is supposed to be caught! :) It
> should never get to the top-level & show the ugly message that you
> mention. *Plus* that ugly message is extremely useful as it contains the
> trace, represented as a string.
>
>> If someone wants me to try this new exception
>> handling class
>> and use it for the proposal, by all means I will be glad to try it out.
>
> I personally don't like this idea, but perhaps Michael can give you some
> pointers. I'm all for removing dependencies, as I think that the base
> Exception class works the way it should.
Have you guys looked at PEAR_ErrorStack? It has the capability to specify an
exception class to be thrown -- seems like anything like a collection of
exception types should extend PEAR_ErrorStack in some way.
--
Killersoft.com