Re: Mail_IMAP 2.0.0 alpha 1
| From: | Hans Lellelid | Date: | Tue, 06 Jul 2004 12:07:32 +0000 |
| Subject: | Re: Mail_IMAP 2.0.0 alpha 1 | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-31636@lists.php.net to get a copy of this message | ||
Tobias Schlitt wrote:
Hi David Costa! You wrote: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. 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. 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. Hansjust 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.