Re: Re: PEAR's Error Handling and PHP5

From: Date: Thu, 08 Jun 2006 01:09:13 +0000
Subject: Re: Re: PEAR's Error Handling and PHP5
References: 1 2 3 4 5 6 7 8 9  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-42852@lists.php.net to get a copy of this message
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. -- Justin Patrin

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