Re: Mail_IMAP 2.0.0 alpha 1
| From: | Tobias Schlitt | Date: | Tue, 06 Jul 2004 13:00:56 +0000 |
| Subject: | Re: Mail_IMAP 2.0.0 alpha 1 | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-31644@lists.php.net to get a copy of this message | ||
Hi Hans Lellelid! You wrote:
>>>just jumping into this, I don't think we should force errorStack vs
>>>exceptions in PHP 5.
>> We should force usage of ErrorStack, IMHO, since it's a nice successor to
>> Error and allows handling of exceptions, too.
> I disagree, Toby. I think the only thing it provides is ability to
> handle warnings / notices in a *stack* system. This is fine, but most
> packages & apps (at least in my experience) don't really use
> warnings/notices anyway.
Of course they don't, since PEAR_Error does not provide this. In my eyes the
usage of a level based error handling is a wonderfull option.
> The beauty with exceptions is being able to catch & re-throw them,
> adding additional context information along the way. Sure, I suppose
> you can use errorstack to throw your exceptions for you, but why? Why
> not just throw them directly? You get a clearer stack trace and with
> the stuff that's being bolted on to PEAR_Exception you're not going to
> lose any functionality either. Also, last I checked ErrorStack didn't
> support nesting Exceptions, which IMO is crucial to that system of error
> handling.
Ok, agreed, but the way should be to get a common error handling to PHP5
packages, as we did for PHP4. It's not feasible for users to always dig into
a package to see wether it throws exceptions, returns PEAR_Errors, integer
error codes or anything else imaginable.
> Stacks have their place for warning/notice management. Warnings &
> notices should never be handled the same way as exceptions, though. I
> don't think we need a single solution that is designed to do both.
> PEAR_ErrorStack is great for PHP4-PHP5 apps, but I don't anticipate
> there being very many of these given how PHP5 code isn't backwards
> compatible.
> So, let people use it for warnings - if applicable. Let others throw
> Exceptions. It's what the rest (non-PEAR) of the PHP5 world will be
> doing ... that in itself has to be worth something.
As said before, I agree with your argumentation, but I still insist on
forcing people to a common error handling method (let it be PEAR
exceptions), to keep our usability level.
Regards,
Toby
--
Tobias Schlitt GPG Key: 0xA6529579
a passion for php http://www.schlitt.info
Like to say "thank you"? - http://pear.php.net/wishlist.php/toby