Re: new push/pop error handlings

From: Date: Sun, 29 Jul 2001 05:18:08 +0000
Subject: Re: new push/pop error handlings
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-1108@lists.php.net to get a copy of this message
"Stig S. Bakken" wrote: > > "Tomas V.V.Cox" wrote: > > > > yavor shahpasov wrote: > > > > > > This is very cool and maybe I'm missing a bit on the discussion, but > > > shouldn't it be integrated into the current raseError functionality, maybe > > > if the error is not displayed push it to the error stack and set a > > > errorOccured flag. Then each getMessage would pop it out. > > > > > > > Yes, this was discussed also. My idea was to provide a method to raise > > the error contained in a error object. > > > > $this->pushErrorHandler(PEAR_ERROR_RETURN); > > $error = $db->query(..); > > $this->popErrorHandlier(); > > if (DB::isError($error)) { > > // this will act much similar as > > // $this->raiseError($error->getMessage()); > > return $this->raiseErrorObj($error); > > } > > > > Other ideas? > > Why can't raiseError() just do an isError test on its first parameter > and just use it as-is if it is an error object already? > Stig again got the key :) I commited the needed changes to PEAR.php and Pear DB. Pgsql now uses the entire stuff pop/push error handlers and raise error objects. Good night :) Tomas V.V.Cox

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