Re: exceptions
| From: | Hans Lellelid | 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: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). HansOn Tuesday 08 June 2004 13:11, Justin Patrin wrote:yup this is where I see the problemThis 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 backup? How could that be done with either error objects or exceptions?