Re: Re: PEAR's Error Handling and PHP5

From: Date: Thu, 08 Jun 2006 05:47:54 +0000
Subject: Re: Re: PEAR's Error Handling and PHP5
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-42854@lists.php.net to get a copy of this message
On 6/7/06, Hans L <hlellelid@gmail.com> wrote:
Justin Patrin wrote: On 6/7/06, Hans L <hlellelid@gmail.com> wrote:
2) fragmentation of error handling schemes (but I guess this can be lived with)
But it shouldn't have to be lived with. People shouldn't have to rewrite packages they want to use in order for their apps to have cohesive error handling. PEAR packages are OO objects; exceptions are IMO *the* accepted OO way to handle errors and they are BUILT INTO THE PHP LANGUAGE. I don't understand why PEAR, which makes all sorts of other prescriptions about sourcecode, wouldn't decide that its packages will use a unified error handling system -- especially when that system requires no external dependencies.
PEAR has and does prescribe an error handling mechanism. For PHP4 it was PEAR_Error (or PEAR_ErrorStack, although this is barely used). For PHP5, due to the RFC which passed, it is PEAR_Exception. What I was trying for here was a discussion of why PEAR_Error might be needed in PHP5. Lukas brought up a good point but the overall feeling seems to be that Exceptions are wanted and should work fine for PEAR packages in PHP5. So the consensus here is still to use PEAR_Exception for PHP5 packages only. Sorry, I guess I thought you were talking about (and I was responding to) Pierre's assertion that PEAR does not / should not prescribe PEAR_Error or PEAR_Exception, and that people should be allowed to choose whatever they want. That, I think, would be a mistake; I do think PEAR should be more than a collection of classes, and I think that what does make it more than a collection of classes is the conventions and guidelines that enable packages to work together.
I agree. -- Justin Patrin

« previous php.pear.dev (#42854) next »