Re: exceptions

From: Date: Tue, 08 Jun 2004 18:18:37 +0000
Subject: Re: exceptions
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-30193@lists.php.net to get a copy of this message
Justin Patrin wrote:
Alan Knowles wrote:
[snip]
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.
Yes, that's probably the best solution. You do lose (well, bury) the context of the originating error, but the trace should still be fairly usable since it'll just have an additional line or two for the call to raiseError(). One thing that would be hard in that model is to return different kinds of Exceptions. It's certainly easy to imagine classes that could make use of several different types (classes) of exceptions; I suppose you could add another param to your raiseError() or something. Hans

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