Re: exceptions

From: Date: Tue, 08 Jun 2004 18:50:04 +0000
Subject: Re: exceptions
References: 1 2 3 4 5  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-30198@lists.php.net to get a copy of this message
Lukas Smith wrote:
Jackson Miller wrote:
On Tuesday 08 June 2004 13:11, Justin Patrin wrote:
This is exactly the kind of thing that I was thinking. You set PEAR_ERROR_RETURN or PEAR_ERROR_EXCEPTION. If the coder selectes exceptions, they get them *instead of* PEAR_Errors. Either should work.
Would that work? Aren't there PEAR modules that check for errors or cascade errors back
up?    How could that be done with either error objects or exceptions?
yup this is where I see the problem
Yeah, you're right; this is a problem. Perhaps there isn't a single solution like this that'll work. When package X using package Y upgrades to use PHP5 it may need to still check for PEAR_Error returns from package Y, and possibly wrap & throw these as Exceptions (if package X chooses to use exceptions). There doesn't seem to be a very smooth migration path from PEAR_Error -> Exceptions. If a class stands alone (doesn't rely on any other packages) then the raiseError() method would work (or half work, or whatever). Hans

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