Re: errorStack

From: Date: Fri, 14 May 2004 11:27:32 +0000
Subject: Re: errorStack
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-29246@lists.php.net to get a copy of this message
Alan Knowles wrote:
Lukas Smith wrote:
Hi, I am interested in hearing some thoughts on how we can best leverage errorStack in PEAR. Is the idea that we allow people to return "false" on error and simply put the error object on the stack for the user to fetch if he feels like it?
I think developers have to decide that on a case by case basis.. - eg. in dataobjects, fetch returns true|false, so this works, and does something like the stacking in errorstack. while($object->fetch()) { } however, $db = DB::connect(); seems alot more sensible to return a error object if it fails.... I dont think you could make many 'hard and fast' rules on that. - it's a judgement call...
yeah .. seems to me like in the same places where you may want to use an exception you would return the error object and everywhere else simply push to a stack ... either way iterators are definately prime examples where you would want to push the error object to the stack i wasnt really looking for a hard rule .. more general pondering regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07

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